mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 08:03:30 +02:00
Fix addLayers not working with singleMarkerMode.
(cherry picked from commit 02c75f164f1bb85f61329e0f3e89b0dc527301ee) Conflicts: dist/leaflet.markercluster.js
This commit is contained in:
Vendored
+11
-11
@@ -57,17 +57,6 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
return this.addLayers(array);
|
return this.addLayers(array);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.options.singleMarkerMode) {
|
|
||||||
layer.options.icon = this.options.iconCreateFunction({
|
|
||||||
getChildCount: function () {
|
|
||||||
return 1;
|
|
||||||
},
|
|
||||||
getAllChildMarkers: function () {
|
|
||||||
return [layer];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this._map) {
|
if (!this._map) {
|
||||||
this._needsClustering.push(layer);
|
this._needsClustering.push(layer);
|
||||||
return this;
|
return this;
|
||||||
@@ -536,6 +525,17 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
gridUnclustered = this._gridUnclustered,
|
gridUnclustered = this._gridUnclustered,
|
||||||
markerPoint, z;
|
markerPoint, z;
|
||||||
|
|
||||||
|
if (this.options.singleMarkerMode) {
|
||||||
|
layer.options.icon = this.options.iconCreateFunction({
|
||||||
|
getChildCount: function () {
|
||||||
|
return 1;
|
||||||
|
},
|
||||||
|
getAllChildMarkers: function () {
|
||||||
|
return [layer];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//Find the lowest zoom level to slot this one in
|
//Find the lowest zoom level to slot this one in
|
||||||
for (; zoom >= 0; zoom--) {
|
for (; zoom >= 0; zoom--) {
|
||||||
markerPoint = this._map.project(layer.getLatLng(), zoom); // calculate pixel position
|
markerPoint = this._map.project(layer.getLatLng(), zoom); // calculate pixel position
|
||||||
|
|||||||
+11
-11
@@ -50,17 +50,6 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
return this.addLayers(array);
|
return this.addLayers(array);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.options.singleMarkerMode) {
|
|
||||||
layer.options.icon = this.options.iconCreateFunction({
|
|
||||||
getChildCount: function () {
|
|
||||||
return 1;
|
|
||||||
},
|
|
||||||
getAllChildMarkers: function () {
|
|
||||||
return [layer];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this._map) {
|
if (!this._map) {
|
||||||
this._needsClustering.push(layer);
|
this._needsClustering.push(layer);
|
||||||
return this;
|
return this;
|
||||||
@@ -529,6 +518,17 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
gridUnclustered = this._gridUnclustered,
|
gridUnclustered = this._gridUnclustered,
|
||||||
markerPoint, z;
|
markerPoint, z;
|
||||||
|
|
||||||
|
if (this.options.singleMarkerMode) {
|
||||||
|
layer.options.icon = this.options.iconCreateFunction({
|
||||||
|
getChildCount: function () {
|
||||||
|
return 1;
|
||||||
|
},
|
||||||
|
getAllChildMarkers: function () {
|
||||||
|
return [layer];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//Find the lowest zoom level to slot this one in
|
//Find the lowest zoom level to slot this one in
|
||||||
for (; zoom >= 0; zoom--) {
|
for (; zoom >= 0; zoom--) {
|
||||||
markerPoint = this._map.project(layer.getLatLng(), zoom); // calculate pixel position
|
markerPoint = this._map.project(layer.getLatLng(), zoom); // calculate pixel position
|
||||||
|
|||||||
Reference in New Issue
Block a user