diff --git a/src/layer/Layer.js b/src/layer/Layer.js index c55f557a..5bdcea6c 100644 --- a/src/layer/Layer.js +++ b/src/layer/Layer.js @@ -45,16 +45,16 @@ L.Layer = L.Evented.extend({ this._map = map; this._zoomAnimated = map._zoomAnimated; + if (this.getEvents) { + map.on(this.getEvents(), this); + } + this.onAdd(map); if (this.getAttribution && this._map.attributionControl) { this._map.attributionControl.addAttribution(this.getAttribution()); } - if (this.getEvents) { - map.on(this.getEvents(), this); - } - this.fire('add'); map.fire('layeradd', {layer: this}); }