aboutsummaryrefslogtreecommitdiff
path: root/modern/src/mapManager.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/mapManager.js')
-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 7c7e2929..c597eb58 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];