mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix up removing a marker from the map while it is spiderfied. Fix up a place where markers were left with opacity 0.
This commit is contained in:
@@ -256,6 +256,13 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
|
||||
setTimeout(function () {
|
||||
for (i = childMarkers.length - 1; i >= 0; i--) {
|
||||
m = childMarkers[i];
|
||||
|
||||
if (!m._spiderLeg) { //Has already been unspiderfied
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
m.setOpacity(1);
|
||||
m.setZIndexOffset(0);
|
||||
|
||||
L.FeatureGroup.prototype.removeLayer.call(group, m);
|
||||
@@ -287,5 +294,16 @@ L.MarkerClusterGroup.include({
|
||||
if (this._spiderfied) {
|
||||
this._spiderfied.unspiderfy();
|
||||
}
|
||||
},
|
||||
|
||||
//If the given layer is currently being spiderfied then we unspiderfy it so it isn't on the map anymore etc
|
||||
_unspiderfyLayer: function (layer) {
|
||||
if (layer._spiderLeg) {
|
||||
L.FeatureGroup.prototype.removeLayer.call(this, layer);
|
||||
layer.setOpacity(1);
|
||||
layer.setZIndexOffset(0);
|
||||
this._map.removeLayer(layer._spiderLeg);
|
||||
delete layer._spiderLeg;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -50,6 +50,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
removeLayer: function (layer) {
|
||||
if (this._unspiderfy) {
|
||||
this._unspiderfy();
|
||||
this._unspiderfyLayer(layer);
|
||||
}
|
||||
|
||||
if (!this._topClusterLevel._recursivelyRemoveLayer(layer)) {
|
||||
@@ -477,6 +478,7 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
|
||||
|
||||
setTimeout(function () {
|
||||
L.FeatureGroup.prototype.removeLayer.call(me, layer);
|
||||
layer.setOpacity(1);
|
||||
|
||||
me._animationEnd();
|
||||
}, 250);
|
||||
|
||||
Reference in New Issue
Block a user