mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 00:24:21 +02: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 () {
|
setTimeout(function () {
|
||||||
for (i = childMarkers.length - 1; i >= 0; i--) {
|
for (i = childMarkers.length - 1; i >= 0; i--) {
|
||||||
m = childMarkers[i];
|
m = childMarkers[i];
|
||||||
|
|
||||||
|
if (!m._spiderLeg) { //Has already been unspiderfied
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
m.setOpacity(1);
|
||||||
m.setZIndexOffset(0);
|
m.setZIndexOffset(0);
|
||||||
|
|
||||||
L.FeatureGroup.prototype.removeLayer.call(group, m);
|
L.FeatureGroup.prototype.removeLayer.call(group, m);
|
||||||
@@ -287,5 +294,16 @@ L.MarkerClusterGroup.include({
|
|||||||
if (this._spiderfied) {
|
if (this._spiderfied) {
|
||||||
this._spiderfied.unspiderfy();
|
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) {
|
removeLayer: function (layer) {
|
||||||
if (this._unspiderfy) {
|
if (this._unspiderfy) {
|
||||||
this._unspiderfy();
|
this._unspiderfy();
|
||||||
|
this._unspiderfyLayer(layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this._topClusterLevel._recursivelyRemoveLayer(layer)) {
|
if (!this._topClusterLevel._recursivelyRemoveLayer(layer)) {
|
||||||
@@ -477,6 +478,7 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
|
|||||||
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
L.FeatureGroup.prototype.removeLayer.call(me, layer);
|
L.FeatureGroup.prototype.removeLayer.call(me, layer);
|
||||||
|
layer.setOpacity(1);
|
||||||
|
|
||||||
me._animationEnd();
|
me._animationEnd();
|
||||||
}, 250);
|
}, 250);
|
||||||
|
|||||||
Reference in New Issue
Block a user