aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modern/src/mapManager.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/modern/src/mapManager.js b/modern/src/mapManager.js
index 7c7e292..c597eb5 100644
--- a/modern/src/mapManager.js
+++ b/modern/src/mapManager.js
@@ -86,6 +86,11 @@ const addLayer = (id, source, icon, text, onClick) => {
}
const removeLayer = (id, source) => {
+ const popups = element.getElementsByClassName('mapboxgl-popup');
+ if (popups.length) {
+ popups[0].remove();
+ }
+
map.off('click', id, layerClickCallbacks[id]);
delete layerClickCallbacks[id];