[Marble-devel] Setting maximum zoom value

Dennis Nienhüser earthwings at gentoo.org
Thu Nov 17 17:04:15 UTC 2011


Hi Jon,

On 17.11.2011 11:46, Jon R Flowers wrote:
>
> Hope this is the correct list. First off, thanks for the wonderful 
> widget you guy make. This has save my project a tremendous amount of 
> time and work.
>

thanks for the nice words :-) It would be great if you could add your 
project to our wiki page listing [1].

> I am working an on an application that requires basic mapping 
> features, which marble widget more than supplies, but I just upgraded 
> to version 0.12 of the library and found you fixed a 'bug' that I was 
> taking full advantage of and need in my app. I need to zoom in to a 
> closer detail than what is currently set as the maximumZoom() level. 
> This is required for items that I am painting over the map, not 
> looking for detail level on the map. This is because all the items I 
> am drawing are over the oceans of the world and I need rough coast 
> lines at a normal zoom level. But for fine checking of my 'lines' on 
> the map I need to be able to zoom to see them. Real world distances 
> between these parallel lines will be as close as 25 meters, though 
> usually more like 100 meters. Those lines will not be shown all the 
> time only on problem fixing, the main lines being show will be various 
> distances apart, 100 -- 2400 meters, depending on configuration of 
> that particular project.
>
> I have found that modifying the dgml file can accomplish this, I think 
> it's the wrong way to go about this. Is there a way to override the 
> maximumZoom() in code? So that I don't have to maintain my own set of 
> data for app. This app will be very limited in user base as it is very 
> specific in its use.
>

Changing the .dgml is indeed the way we intended it to happen. Still 
it's possible to do it in the code, basically calling
mapWidget->model()->mapTheme()->head()->zoom()->setMaximum( 8000 );
after the corrent map theme is loaded, where 8000 is the zoom value you 
like to set. Pretty high here already.

Note that when using the library as of today this won't work directly as 
some of the classes needed for this are not exported (copied to the 
include/ dir). You can either ship them with your project or go for the 
hack shown in the attachment. Note that the hack (manually adding the 
class headers) might lead to strange behavior in future Marble versions 
shall we decide to change the classes.

Regards,
Dennis

[1] http://techbase.kde.org/Projects/Marble/MarbleUsedBy

> Thanks for any and all help.
>
> Jon Flowers
>
>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20111117/6089dca1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: marble-max-zoom-hack.cpp
Type: text/x-c++src
Size: 2621 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20111117/6089dca1/attachment.cpp>


More information about the Marble-devel mailing list