mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
Fix issue #79.
When a MarkerClusterGroup has been on a map, but isn't any longer, we still need to clear out its markers. (cherry picked from commit 2a90a86326aee1afd0392efd019d9cdb3f6dd0d0) Conflicts: dist/leaflet.markercluster.js
This commit is contained in:
Vendored
+7
-3
@@ -190,7 +190,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
//If we aren't on the map yet, just blow away the markers we know of
|
||||
if (!this._map) {
|
||||
this._needsClustering = [];
|
||||
return this;
|
||||
this._gridClusters = undefined;
|
||||
this._gridUnclustered = undefined;
|
||||
// return this;
|
||||
}
|
||||
|
||||
if (this._unspiderfy) {
|
||||
@@ -204,8 +206,10 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
}
|
||||
}
|
||||
|
||||
//Reset _topClusterLevel and the DistanceGrids
|
||||
this._generateInitialClusters();
|
||||
if (this._map) {
|
||||
//Reset _topClusterLevel and the DistanceGrids
|
||||
this._generateInitialClusters();
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
@@ -183,7 +183,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
//If we aren't on the map yet, just blow away the markers we know of
|
||||
if (!this._map) {
|
||||
this._needsClustering = [];
|
||||
return this;
|
||||
this._gridClusters = undefined;
|
||||
this._gridUnclustered = undefined;
|
||||
// return this;
|
||||
}
|
||||
|
||||
if (this._unspiderfy) {
|
||||
@@ -197,8 +199,10 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
}
|
||||
}
|
||||
|
||||
//Reset _topClusterLevel and the DistanceGrids
|
||||
this._generateInitialClusters();
|
||||
if (this._map) {
|
||||
//Reset _topClusterLevel and the DistanceGrids
|
||||
this._generateInitialClusters();
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user