[fusion-users] min/max Zoom scales

Julien-Samuel Lacroix jlacroix at mapgears.com
Wed May 21 09:24:58 EDT 2008


Hi,

It's probably better for you to set the MinScale/MaxScale directly 
inside MapGuide. Fusion will then set directly the MinScale/MaxScale of 
your map. I'm not sure where the exact place is, but the code say that 
the Layer resource XML contains a ScaleRange.

If you are trying to hack Fusion code to do what you want, then the 
maxScale option is really what you want, but Fusion probably override 
your settings with those from your map. Search for maxscale in 
fusion/MapGuide/php/LoadMap.php

Julien

Måns Beckman wrote:
> Hi All,
> 
>  
> 
> First I’m just going to tell you that I’m not really a programmer, I’m 
> more of a script kiddie, so bare with me.
> 
>  
> 
> The thing is that we got a customer that wants to limit how close the 
> user can zoom in to the map. So I started to have a look and found out 
> that there was something that made the map not zoom in closer than the 
> scale 1:1. So I started do look in the code for what was preventing 
> this, but I didn’t find anything in the zoom widgets or in the zoom 
> functions in Map.js. So I started to think there was something in 
> openlayers that made it impossible to zoom in more.
> 
>  
> 
> Ok, so eventually I found out that we can send some options when we 
> initialize the open layers map, and I guess that 1:1 is the default 
> value. http://trac.openlayers.org/wiki/SettingZoomLevels
> 
>  
> 
> So I looked in the code for where we initialize an open layer map and 
> found something on line 98 (this is MGE2009 so the exact lines might 
> have changed). Anyway I thought that I would try to send some more 
> options to the map and changed line 94 from
> 
> var options = {controls: [], fallThrough: true};
> 
> to
> 
> var options = {controls: [], fallThrough: true, minScale: 10000};
> 
>  
> 
> When I reload my map it initializes on scale 1:10000, I can zoom in but 
> not out. I try to change minScale to maxScale, to make the opposite 
> happen. But when I do that, nothing happens in the map, it works like I 
> had sent no extra option at all.
> 
>  
> 
> So, could someone explain this behavior? And could someone tell me how 
> to solve my problem without using fixed zoomscales?
> 
>  
> 
> Best regards
> 
> Måns
> 
>  
> 
> -----------------------------------------------------------
> 
> Måns Beckman
> 
> Man and Machine
> 
> Fabriksgatan 13
> 
> 412 50 Göteborg
> 
> Phone: +46 31 - 762 8182
> 
> Mobile: +46 733 - 38 83 19
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> fusion-users mailing list
> fusion-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fusion-users

-- 
Julien-Samuel Lacroix
Mapgears
http://www.mapgears.com/


More information about the fusion-users mailing list