From 634e3f434cb948ca5d109deca7d599bdc0e27590 Mon Sep 17 00:00:00 2001 From: Qiusheng Wu Date: Thu, 2 Nov 2023 10:34:29 -0400 Subject: [PATCH] Fix removing layer bug --- geemap/core.py | 3 +++ 1 file changed, 3 insertions(+) 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: