Remove zoom/moeveend events when deleting datalayer

This commit is contained in:
Yohan Boniface 2023-12-22 18:45:21 +01:00
parent 417f1b9d08
commit 5f8147c274

View file

@ -1116,6 +1116,8 @@ L.U.DataLayer = L.Evented.extend({
this.map.updateDatalayersControl() this.map.updateDatalayersControl()
this.fire('erase') this.fire('erase')
this._leaflet_events_bk = this._leaflet_events this._leaflet_events_bk = this._leaflet_events
this.map.off('moveend', this.onMoveEnd, this)
this.map.off('zoomend', this.onZoomEnd, this)
this.off() this.off()
this.clear() this.clear()
delete this._loaded delete this._loaded