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); + } }