mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
Update build
This commit is contained in:
Vendored
+23
-9
@@ -23,7 +23,11 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
|
||||
disableClusteringAtZoom: null,
|
||||
|
||||
skipDuplicateAddTesting: false
|
||||
skipDuplicateAddTesting: false,
|
||||
|
||||
//Whether to animate adding markers after adding the MarkerClusterGroup to the map
|
||||
// If you are adding individual markers set to true, if adding bulk markers leave false for massive performance gains.
|
||||
animateAddingMarkers: false
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
@@ -79,8 +83,11 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
|
||||
var newCluster = this._topClusterLevel._recursivelyAddLayer(layer, this._topClusterLevel._zoom - 1);
|
||||
|
||||
this._animationAddLayer(layer, newCluster);
|
||||
|
||||
if (this.options.animateAddingMarkers) {
|
||||
this._animationAddLayer(layer, newCluster);
|
||||
} else {
|
||||
this._animationAddLayerNonAnimated(layer, newCluster);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
@@ -432,6 +439,16 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
ne = map.unproject(new L.Point(bounds.max.x + width, bounds.max.y + height));
|
||||
|
||||
return new L.LatLngBounds(sw, ne);
|
||||
},
|
||||
|
||||
//Shared animation code
|
||||
_animationAddLayerNonAnimated: function (layer, newCluster) {
|
||||
if (newCluster === true) {
|
||||
L.FeatureGroup.prototype.addLayer.call(this, layer);
|
||||
} else if (newCluster._childCount === 2) {
|
||||
newCluster._addToMap();
|
||||
newCluster._recursivelyRemoveChildrenFromMap(newCluster._bounds, this._map.getMaxZoom()); //getMaxZoom will always get all children
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -450,12 +467,7 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
|
||||
this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel - this._topClusterLevel._zoom + 1, this._getExpandedVisibleBounds());
|
||||
},
|
||||
_animationAddLayer: function (layer, newCluster) {
|
||||
if (newCluster === true) {
|
||||
L.FeatureGroup.prototype.addLayer.call(this, layer);
|
||||
} else if (newCluster._childCount === 2) {
|
||||
newCluster._addToMap();
|
||||
newCluster._recursivelyRemoveChildrenFromMap(newCluster._bounds, this._map.getMaxZoom()); //getMaxZoom will always get all children
|
||||
}
|
||||
this._animationAddLayerNonAnimated(layer, newCluster);
|
||||
}
|
||||
} : {
|
||||
|
||||
@@ -1664,6 +1676,8 @@ L.MarkerClusterGroup.include({
|
||||
this._map.off('click', this._unspiderfyWrapper, this);
|
||||
this._map.off('zoomstart', this._unspiderfyZoomStart, this);
|
||||
this._map.off('zoomanim', this._unspiderfyZoomAnim, this);
|
||||
|
||||
this._unspiderfy(); //Ensure that markers are back where they should be
|
||||
},
|
||||
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user