[Geomoose-users] zoom limit

Len Kne lkne at houstoneng.com
Tue Mar 2 09:02:54 EST 2010


Google layers work differently than the mapserver and WMS layers we are use to working with in GeoMOOSE.  The Google layers (as well as bing, Yahoo & OSM) are tiled and have set scales that can be called that match their tiles.  Thus the "scales" tag in the mapbook is not going to be able to affect those base layers.

It is possible to change the number of zoom levels and the min and max zoom level of a Google base map.  Unfortunately GM 2.2 is not setup to allow these changes to happen in the mapbook, but I will add a request to trac that we make these parameters configurable in the <map_source>.  A work around for now would be to go in to compiled.js and search for:

                                                } else if(type == 'google' || type == 'virtualearth' || type == 'yahoo') {
                                                                /* remove references layers if people got "creative" */
                                                                reference_layers = '';
                                                                reference_layer_names = [];

                                                                var layer_options = {
                                                                                numZoomLevels: 20,
                                                                                sphericalMercator: true
                                                                };

You can add layer options such as:

                                                                var layer_options = {
                                                                                numZoomLevels: 15,
                                                                                sphericalMercator: true,
                                                                                MIN_ZOOM_LEVEL: 2,
                                                                                MAX_ZOOM_LEVEL: 10
                                                                };

Playing with the zoom levels and min and max, you should be able to change the zoom bar to what you are looking for.  See http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Layer/Google-js.html for more info.

Len

From: Efstathios Arapostathis [mailto:e.arapostathis at gmail.com]
Sent: Monday, March 01, 2010 4:46 PM
To: Dan Little
Cc: geomoose-users at lists.sourceforge.net
Subject: Re: [Geomoose-users] zoom limit

I changed the scales parameter and I added four scales that I want. The scale box down shows them, but stilll there is no zoom limit.

The zoom bar that is at the left of the mapcontainer has many scales...

I tried to use the minscale, maxscale options in the layers tag but it still didn't work.

Do maxscaledom and minscaledom have the same syntax with minscale and maxscale? (maxscaledom="scale param value", minsxaledom="scale param value"). If yes it doesn't work as well. This is how I configured scales parameter:

 <param name="ground_units">m</param>
                        <param name="scales">1733376,200000,220000,250000,27734017</param>
                        <param name="jumpto_scales"><![CDATA[
                        {
                                    'Maximum zoom level' : 1733376,
                                    'Study area' : 27734017
                        }
            ]]></param>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20100302/3498d321/attachment.html


More information about the Geomoose-users mailing list