[OpenLayers-Users] minScale maxScale on layer

toni hernández tonidelacalle at gmail.com
Thu Apr 16 06:50:55 EDT 2009


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/74f6652b/attachment.html


More information about the Users mailing list