mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 00:24:21 +02:00
Use the _wLatLng of a child cluster for its weighting. Keep the same cLatLng as our child clusters.
This commit is contained in:
@@ -65,7 +65,7 @@ L.MarkerCluster = L.Marker.extend({
|
|||||||
_expandBounds: function (marker) {
|
_expandBounds: function (marker) {
|
||||||
|
|
||||||
var addedCount,
|
var addedCount,
|
||||||
addedLatLng = marker._latlng;
|
addedLatLng = marker._wLatLng || marker._latlng;
|
||||||
|
|
||||||
if (marker instanceof L.MarkerCluster) {
|
if (marker instanceof L.MarkerCluster) {
|
||||||
this._bounds.extend(marker._bounds);
|
this._bounds.extend(marker._bounds);
|
||||||
@@ -77,7 +77,7 @@ L.MarkerCluster = L.Marker.extend({
|
|||||||
|
|
||||||
if (!this._latlng) {
|
if (!this._latlng) {
|
||||||
// when clustering, take position of the first point as the cluster center
|
// when clustering, take position of the first point as the cluster center
|
||||||
this._latlng = this._cLatLng = addedLatLng;
|
this._latlng = this._cLatLng = marker._cLatLng || addedLatLng;
|
||||||
}
|
}
|
||||||
|
|
||||||
// when showing clusters, take weighted average of all points as cluster center
|
// when showing clusters, take weighted average of all points as cluster center
|
||||||
|
|||||||
Reference in New Issue
Block a user