From f1d38e74851a1adbc946be9a8705fc4e7e5f7ec4 Mon Sep 17 00:00:00 2001 From: James Lyne Date: Tue, 31 Aug 2021 15:55:39 +0100 Subject: [PATCH] Fix layer control error when switching servers --- src/leaflet/control/LiveAtlasLayerControl.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/leaflet/control/LiveAtlasLayerControl.ts b/src/leaflet/control/LiveAtlasLayerControl.ts index f776e97..009ead5 100644 --- a/src/leaflet/control/LiveAtlasLayerControl.ts +++ b/src/leaflet/control/LiveAtlasLayerControl.ts @@ -222,4 +222,10 @@ export class LiveAtlasLayerControl extends Control.Layers { Layers.prototype._checkDisabledLayers.call(this); return label; } + + onRemove(map: LeafletMap) { + this._layerControlInputs = []; + + (super.onRemove as Function)(map); + } }