diff --git a/geemap/core.py b/geemap/core.py index 73a057d4b5..6d95406a44 100644 --- a/geemap/core.py +++ b/geemap/core.py @@ -715,6 +715,9 @@ def remove(self, widget: Any) -> None: control.close() return + if hasattr(widget, "name") and widget.name in self.ee_layers: + self.ee_layers.pop(widget.name) + if ee_layer := self.ee_layers.pop(widget, None): tile_layer = ee_layer.get("ee_layer", None) if tile_layer is not None: