mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
Working on removeLayer, works so long as no cluster ever needs removing
This commit is contained in:
@@ -91,7 +91,7 @@ L.MarkerCluster = L.Marker.extend({
|
||||
|
||||
_removeChildMarker: function (marker) {
|
||||
var markers = this._markers,
|
||||
group = this._group, i;
|
||||
i;
|
||||
|
||||
for (i = markers.length - 1; i >= 0; i--) {
|
||||
if (markers[i] === marker) {
|
||||
@@ -101,6 +101,7 @@ L.MarkerCluster = L.Marker.extend({
|
||||
while (p) {
|
||||
p._childCount--;
|
||||
p._recalculateBounds();
|
||||
p._updateIcon();
|
||||
p = p._parent;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -103,12 +103,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
this._unspiderfyLayer(layer);
|
||||
}
|
||||
|
||||
if (!this._topClusterLevel._recursivelyRemoveLayer(layer)) {
|
||||
//If this happens you are doing something bad
|
||||
//If you've moved a marker that is in the cluster then that would be why
|
||||
//console.log('failed to remove');
|
||||
var a = 0;
|
||||
}
|
||||
layer.__cluster._removeChildMarker(layer);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user