[OpenLayers-Users] Capture LayerSwitcher Events

Tobias Reinicke ramotswa at gmail.com
Fri Apr 13 10:32:25 EDT 2012


Not sure if that was the answer you were after Francesco, the way I read
your question was a bit different, and to do what I think you're trying to
do you can use layer event listeners.. which will basically do what you
want.

i.e loadstart and loadend events.

<code>
 layer.events.register("loadstart", layer, function() {
                this.logEvent("Load Start");
            });
or
layer.events.register("loadend", layer, function() {
                this.logEvent("Load End. Grid:" + this.grid.length + "x" +
this.grid[0].length);
            });
</code>

Taken from

http://dev.openlayers.org/releases/OpenLayers-2.11/examples/layerLoadMonitoring.html

which doesn't actually work but look at the source..

Toby


On 13 April 2012 15:18, Fernando Norte <fernando at globalgeo.com.br> wrote:

> With Firebug and jQuery.
> Identify the box of inputs with Firebug and try jQuery methods like
> .each() (for each input) .onChange() (to detect alterations in form).
>
> Remember: OpenLayers is a JAVASCRIPT framework, so, javascript knowledge
> is gold!
>
>
>
>
>
> 2012/4/13 francescoboccacci at libero.it <francescoboccacci at libero.it>
>
>> Hi all,
>> i'm using OpenLayers.Control.LayerSwitcher and i would like to capture the
>> switch layer event.. How can i do it?
>> Thanks
>>
>>
>> Faancesco
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120413/9e504740/attachment-0001.html


More information about the Users mailing list