mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-03 08:01:38 +02:00
Update Build
This commit is contained in:
Vendored
+18
-3
@@ -586,6 +586,7 @@ L.MarkerCluster = L.Marker.extend({
|
||||
},
|
||||
|
||||
_addChild: function (new1) {
|
||||
this._expandBounds(new1);
|
||||
if (new1 instanceof L.MarkerCluster) {
|
||||
this._childClusters.push(new1);
|
||||
this._childCount += new1._childCount;
|
||||
@@ -598,18 +599,31 @@ L.MarkerCluster = L.Marker.extend({
|
||||
this.setIcon(this._group.options.iconCreateFunction(this._childCount));
|
||||
}
|
||||
|
||||
this._expandBounds(new1);
|
||||
},
|
||||
|
||||
_expandBounds: function (marker) {
|
||||
|
||||
var addedCount,
|
||||
addedLatLng;
|
||||
|
||||
if (marker instanceof L.MarkerCluster) {
|
||||
this._bounds.extend(marker._bounds);
|
||||
addedCount = marker._childCount;
|
||||
addedLatLng = marker._latlng;
|
||||
} else {
|
||||
this._bounds.extend(marker.getLatLng());
|
||||
addedLatLng = marker.getLatLng();
|
||||
this._bounds.extend(addedLatLng);
|
||||
addedCount = 1;
|
||||
}
|
||||
|
||||
this._latlng = this._bounds.getCenter();
|
||||
var totalCount = this._childCount + addedCount;
|
||||
|
||||
if (!this._latlng) {
|
||||
this._latlng = new L.LatLng(addedLatLng.lat, addedLatLng.lng);
|
||||
} else {
|
||||
this._latlng.lat = (addedLatLng.lat * addedCount + this._latlng.lat * this._childCount) / totalCount;
|
||||
this._latlng.lng = (addedLatLng.lng * addedCount + this._latlng.lng * this._childCount) / totalCount;
|
||||
}
|
||||
},
|
||||
|
||||
//Set our markers position as given and add it to the map
|
||||
@@ -1003,6 +1017,7 @@ L.MarkerCluster = L.Marker.extend({
|
||||
});
|
||||
|
||||
|
||||
|
||||
L.DistanceGrid = function (cellSize) {
|
||||
this._cellSize = cellSize;
|
||||
this._sqCellSize = cellSize * cellSize;
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user