[OpenLayers-Users] minScale maxScale on layer

Arnd Wippermann arnd.wippermann at web.de
Thu Apr 16 09:02:10 EDT 2009


Hi,
 
I use minScale and maxScale for WMS layers, but my scales more like 6643704
(EPSG:4326, EPSG:32627) to display whole Spain. Perhaps you have to set max
and minResolution.
 
Arnd
 
  _____  

Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von toni hernández
Gesendet: Donnerstag, 16. April 2009 12:51
An: Bill Thoen
Cc: users at openlayers.org
Betreff: Re: [OpenLayers-Users] minScale maxScale on layer


hi,
thanks for the answer.
I saw the examples and It looks like minScale and maxScale refer either to
the map object or third part layers.

I tried this code (and several more) on a WMS Layer without any luck.
I mean the layer is always visible.

Also, when I execute getScale the values are quite understandable. (like 107
for the whole territory of spain!!!!).

var catastreLayer = new OpenLayers.Layer.WMS(
                        "Cadastre",
 
"http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx",
                        {layers: 'Catastro', transparent: "true", format:
"image/png"},{tileSize: new  OpenLayers.Size(512,512), singleTile:true,
buffer: 0,minScale: 1/100,maxScale: 1/400}
            );
map.addLayer([catastreLayer]);


2009/4/15 Bill Thoen <bthoen at gisnet.com>


There's a good description on that subject right here:
http://trac.openlayers.org/wiki/SettingZoomLevels

- Bill Thoen 


toni hernández wrote:


Does anyone know if it is possible to set the minscale and maxscale on a
layer so it shows and hides depending on the scale of the map.

If tried to specify minScale:100, maxScale: 5000 (so the layer appears
between the two scales) on the layer but the layer is still always visible.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090416/39908531/attachment.html


More information about the Users mailing list