R: Re: [OpenLayers-Users] Capture LayerSwitcher Events

francescoboccacci at libero.it francescoboccacci at libero.it
Fri Apr 13 11:39:53 EDT 2012


Hi all,thanks for your help.. i investigate on Openlayer API and i found the answer in this way:
 map.events.register('changebaselayer', map, function(){ .........

Thanks for your help
Francesco





----Messaggio originale----

Da: ramotswa at gmail.com

Data: 13/04/2012 16.32

A: "Fernando Norte"<fernando at globalgeo.com.br>

Cc: "francescoboccacci at libero.it"<francescoboccacci at libero.it>, <openlayers-users at lists.osgeo.org>

Ogg: Re: [OpenLayers-Users] Capture LayerSwitcher Events



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");
            });orlayer.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/09bc4b5a/attachment.html


More information about the Users mailing list