[OpenLayers-Users] changelayer event

Mengu mengukagan at gmail.com
Wed Aug 4 09:48:27 EDT 2010


Hello everyone.

I am listening the "changelayer" event on map.events like this:

    ctx.map.events.on({
        "changelayer": function(e) {
            if(e.property === "visibility") {
                        alert(e.object.baseLayer.name);
            }
        }
    });

the problem here is, when i check the the baseLayer.name via console.log(e)
I see the newly selected layer's name but when I use alert() I get the
previously selected layer's name. 

my goal here is to get the newly selected layer's name and index from the
layer switcher. any help or direction is appreciated.

thanks in advance.
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/changelayer-event-tp5372564p5372564.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list