mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 00:25:06 +02:00
Fix child counting bug
This commit is contained in:
@@ -87,6 +87,7 @@ L.MarkerCluster = L.Marker.extend({
|
||||
if (!this._haveGeneratedChildClusters && this._canAcceptPosition(layer.getLatLng(), zoom)) {
|
||||
//Don't need to cluster it in as we haven't clustered
|
||||
this._addChild(layer);
|
||||
this._childCount++;
|
||||
result = true;
|
||||
} else {
|
||||
for (var i = this._childClusters.length - 1; i >= 0; i--) {
|
||||
@@ -95,6 +96,7 @@ L.MarkerCluster = L.Marker.extend({
|
||||
if (c._bounds.contains(layer.getLatLng()) || c._canAcceptPosition(layer.getLatLng(), zoom + 1)) {
|
||||
result = c._recursivelyAddLayer(layer, zoom + 1);
|
||||
if (result) {
|
||||
this._childCount++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -114,15 +116,14 @@ L.MarkerCluster = L.Marker.extend({
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (result) {
|
||||
this._childCount++;
|
||||
if (this._icon) {
|
||||
this.setIcon(this._group.options.iconCreateFunction(this._childCount));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (result) {
|
||||
//if (!this._zoom) { //TODO: Enable this when i've tracked the weird bug
|
||||
this.setIcon(this._group.options.iconCreateFunction(this._childCount));
|
||||
//}
|
||||
this._recalculateBounds();
|
||||
}
|
||||
if (result === true) {
|
||||
if (this._icon) {
|
||||
result = this;
|
||||
|
||||
Reference in New Issue
Block a user