Andreas,

I just checked and you're absolutely right. That event would do the trick.

Thanks,

Alexandre


On 10-10-21 10:47 AM, Andreas Hocevar wrote:
Hi,

without thinking about it a lot, and without having tried, what comes to mind 
is that you could register a listener for the visibilitychanged event and check 
the inRange property of the layer inside the listener.

Regards,
Andreas.

On Oct 21, 2010, at 16:34 , Alexandre Dube wrote:

Hi devs,

  I'd like to develop a new feature for the GeoExt.tree.LayerNode element : disable 
the UI (checkbox&  text) when the layer is not 'inRange', pretty much like what 
the LayerSwitcher control already does.  So far, I've taken a look at the control 
and noticed it listen to the map 'changelayer' event in order to do that.  Unless 
I'm mistaken, the event is triggered once per layer changed, but each iteration 
check for all the layers in the control.  Only the first iteration actually does 
the changes (disable the DOM elements).

  In GeoExt, I want to put these events inside LayerNode class.  I'd like to be able to 
register the event at the layer level, not the map, in order to execute each event once 
per layer.  I could pick the "moveend" layer event and check if the 'inRange' 
of the layer is set to 'false' then disable the node, but it would be unnecessarily 
triggered once every movend.  I'd rather do it on 'inRange' change only, but there is 
currently no such event.

  Would it make sense to add a 'rangechanged' event in the layer object ?

Thanks,

--
Alexandre Dubé
Mapgears
www.mapgears.com

_______________________________________________
Dev mailing list
d...@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-dev




--
Alexandre Dubé
Mapgears
www.mapgears.com

_______________________________________________
Dev mailing list
d...@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-dev

Reply via email to