mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-04 16:12:20 +02:00
Implementation of LayerGroup.getLayer with really bad performance. fixes #244
This commit is contained in:
@@ -317,6 +317,19 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
|||||||
return layers;
|
return layers;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//Overrides LayerGroup.getLayer, WARNING: Really bad performance
|
||||||
|
getLayer: function (id) {
|
||||||
|
var result = null;
|
||||||
|
|
||||||
|
this.eachLayer(function (l) {
|
||||||
|
if (L.stamp(l) === id) {
|
||||||
|
result = l;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
|
||||||
//Returns true if the given layer is in this MarkerClusterGroup
|
//Returns true if the given layer is in this MarkerClusterGroup
|
||||||
hasLayer: function (layer) {
|
hasLayer: function (layer) {
|
||||||
if (!layer) {
|
if (!layer) {
|
||||||
|
|||||||
Reference in New Issue
Block a user