mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
Fix a crash that can happen if you remove the layer from the map while a zoom animation is going on. Fixes #36
This commit is contained in:
@@ -127,6 +127,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
this._map.off('zoomend', this._zoomEnd, this);
|
||||
this._map.off('moveend', this._moveEnd, this);
|
||||
|
||||
//In case we are in a cluster animation
|
||||
this._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');
|
||||
|
||||
if (this._spiderfierOnRemove) { //TODO FIXME: Not sure how to have spiderfier add something on here nicely
|
||||
this._spiderfierOnRemove();
|
||||
}
|
||||
@@ -420,7 +423,9 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
|
||||
this._inZoomAnimation++;
|
||||
},
|
||||
_animationEnd: function () {
|
||||
this._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');
|
||||
if (this._map) {
|
||||
this._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');
|
||||
}
|
||||
this._inZoomAnimation--;
|
||||
},
|
||||
_animationZoomIn: function (previousZoomLevel, newZoomLevel) {
|
||||
|
||||
Reference in New Issue
Block a user