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

Christopher Schmidt crschmidt at metacarta.com
Wed Mar 11 13:32:59 EDT 2009


On Wed, Mar 11, 2009 at 12:20:07PM -0500, William Kyngesburye wrote:
> 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)

It's currently not marked as an API property; I've changed that in
r9014.

(Both before and after, it would be in
http://dev.openlayers.org/docs/files/OpenLayers/Layer-js.html#OpenLayers.Layer.calculateInRange
; this set of docs is designed to be the 'full' library, rather than
just things that we promise not to change during a 2.x release.)

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list