mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 00:25:06 +02:00
Make clearLayers work when we aren't on the map. Fixes #26
This commit is contained in:
@@ -66,6 +66,12 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
clearLayers: function () {
|
||||
//Need our own special implementation as the LayerGroup one doesn't work for us
|
||||
|
||||
//If we aren't on the map yet, just blow away the markers we know of
|
||||
if (!this._map) {
|
||||
this._needsClustering = [];
|
||||
return this;
|
||||
}
|
||||
|
||||
//Remove all the visible layers
|
||||
for (var i in this._layers) {
|
||||
if (this._layers.hasOwnProperty(i)) {
|
||||
|
||||
Reference in New Issue
Block a user