1.0b1 _onLayerChange() now pass target instead of layer when firering event on map

26 views
Skip to first unread message

Emmanuel Saracco

unread,
Jul 30, 2015, 1:15:03 AM7/30/15
to Leaflet
Hi all,

I saw that layers API was refactored. Great! But I can not access layer name anymore from add/remove events:

1.0b1 _onLayerChange():
this._map.fire(type, e.target);

0.7.3 _onLayerChange():
var obj = this._layers[L.stamp(e.layer)];
this._map.fire(type, obj);

With 0.7.3, this one is OK:
map.on('overlayadd', function(layer) { console.log(layer.name)}

But 1.0beta1 broke it.

Can you please tell me how can I retrieve layer name from overlayadd/overlayremove events now?

Bye

Emmanuel Saracco

unread,
Aug 21, 2015, 9:24:51 AM8/21/15
to Leaflet
Fixed in master branch.
Reply all
Reply to author
Forward
0 new messages