[OpenLayers-Users] how to get current display status of a layer (not its setting)

William Kyngesburye woklist at kyngchaos.com
Wed Mar 11 13:20:07 EDT 2009


On Mar 11, 2009, at 12:10 PM, Christopher Schmidt wrote:

> On Wed, Mar 11, 2009 at 11:48:29AM -0500, William Kyngesburye wrote:
>> The visibility property tells OL to display a layer, if the scale or
>> resolution is in the range set for the layer.  Is there a way to get
>> the current actual visibility of a layer other than checking the
>> visibility property and comparing the layer's min/max scale  
>> properties
>> with the current scale?  IOW, what I'm looking for is a convenience
>> function already built into OL.
>
> var vis = (layer.getVisibility() && layer.calculateInRange());
>
>>
That's simple enough.  Why is calculateInRange() not in the OL  
documentation for Layers?  (I thought I'd have to check maxScale and  
minScale properties)

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Oh, look, I seem to have fallen down a deep, dark hole.  Now what  
does that remind me of?  Ah, yes - life."

- Marvin





More information about the Users mailing list