[OpenLayers-Users] How to Set Up Layer Visibility by Scale

Bart van den Eijnden (OSGIS) bartvde at osgis.nl
Sat Mar 21 06:55:57 EDT 2009


Indeed, minScale > maxScale in OL.

See:
http://trac.openlayers.org/wiki/SettingZoomLevels

Best regards,
Bart

Bill Thoen wrote:
> Thanks... I never would have guessed that. Is the sense of "max" and 
> "min" backwards as well? In other words, does maxscale apply to the 
> largest denominator or the largest scale (1/denominator)? To put it more 
> explicitly, if I set maxscale to 100000 does that mean that the layer is 
> visible between 1:1 and 1:100,000 or that it is visible only at scales 
> smaller than 1:100,000?
>
> Bart van den Eijnden (OSGIS) wrote:
>   
>> Hi,
>>
>> minScale and maxScale should be denominators, so use 100000 and not 
>> 0.00001.
>>
>> Best regards,
>> Bart
>>
>> Bill Thoen wrote:
>>     
>>> I'm trying to get a WMS layer to appear only within a specific scale 
>>> range , and I not having any luck setting minscale and maxscale 
>>> properties when I load the layer onto the map. For example, I want 
>>> one layer land parcels to show from 1:1 up to 1:100,000 scale, so I 
>>> set minscale to 0.00001, expecting that once I zoom out to say, 
>>> 1:120,000, the land parcel layer should have its visibility property 
>>> set to false and the layer should be invisible. But it continues to 
>>> stay visible.
>>>
>>> Can somebody tell me what I'm doing wrong? (I'm using OpenLayers 2.7, 
>>> in case that matters.)
>>>
>>> - Bill Thoen
>>> _______________________________________________
>>> Users mailing list
>>> Users at openlayers.org
>>> http://openlayers.org/mailman/listinfo/users
>>>
>>>
>>>   
>>>       
>>     
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
>   


-- 
Bart van den Eijnden
OSGIS, Open Source GIS
bartvde at osgis.nl
http://www.osgis.nl




More information about the Users mailing list