[OpenLayers-Users] minScale maxScale on layer

Christopher Schmidt crschmidt at metacarta.com
Wed Apr 15 16:36:28 EDT 2009


On Wed, Apr 15, 2009 at 10:19:56PM +0200, toni hernández wrote:
> hi,
> 
> 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.

Flip them around. maxScale is most zoomed in; the numbers you're using
are scaleDenominators. You can specify scale like:

  minScale: 1/100, maxScale: 1/5000

And see that 1/100 is much larger than 1/5000, and therefore you shoudl
switch them.

-- Chris


> thanks!!!

> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users


-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list