[OpenLayers-Dev] Layer 'inRange' change event...
Andreas Hocevar
ahocevar at opengeo.org
Thu Oct 21 10:47:35 EDT 2010
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
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Dev
mailing list