Merge pull request #1484 from umap-project/layer-events-off

Remove zoom/moeveend events when deleting datalayer
This commit is contained in:
Yohan Boniface 2023-12-23 08:41:16 +01:00 committed by GitHub
commit e19508a1df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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