[OpenLayers-Dev] Layer 'inRange' change event...

Alexandre Dube adube at mapgears.com
Thu Oct 21 10:34:30 EDT 2010


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



More information about the Dev mailing list