mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 00:25:06 +02:00
Working towards getting addLayer/removeLayer working again
This commit is contained in:
@@ -115,7 +115,7 @@ L.MarkerCluster = L.Marker.extend({
|
||||
}
|
||||
|
||||
if (result) {
|
||||
if (!this._zoom) {
|
||||
if (!('_zoom' in this)) {
|
||||
this.setIcon(this._group.options.iconCreateFunction(this._childCount));
|
||||
}
|
||||
this._recalculateBounds();
|
||||
|
||||
@@ -257,8 +257,8 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
|
||||
this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel - this._topClusterLevel._zoom + 1, this._getExpandedVisibleBounds());
|
||||
},
|
||||
_animationAddLayer: function (layer, newCluster) {
|
||||
L.FeatureGroup.prototype.addLayer.call(this, newCluster);
|
||||
if (newCluster !== layer && newCluster._childCount === 2) {
|
||||
L.FeatureGroup.prototype.addLayer.call(this, layer);
|
||||
if (newCluster !== true && newCluster._childCount === 2) {
|
||||
newCluster._recursivelyRemoveChildrenFromMap(newCluster._bounds, 1);
|
||||
}
|
||||
}
|
||||
@@ -377,7 +377,7 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
|
||||
var me = this;
|
||||
|
||||
L.FeatureGroup.prototype.addLayer.call(this, layer);
|
||||
if (newCluster !== layer) {
|
||||
if (newCluster !== true) {
|
||||
if (newCluster._childCount > 2) { //Was already a cluster
|
||||
|
||||
this._forceLayout();
|
||||
|
||||
Reference in New Issue
Block a user