From 7ec5c24d3f1b6f442fedbd36be777e54d1214e02 Mon Sep 17 00:00:00 2001 From: Jose Buitron Date: Thu, 7 Sep 2023 12:33:46 -0500 Subject: [PATCH] fix: Only add popup if not opened --- src/sharedData/visualization/components/Visualization.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sharedData/visualization/components/Visualization.js b/src/sharedData/visualization/components/Visualization.js index 96ed1e3cd..aa783e203 100644 --- a/src/sharedData/visualization/components/Visualization.js +++ b/src/sharedData/visualization/components/Visualization.js @@ -278,7 +278,10 @@ const MapboxLayer = props => { if (!map || !popupData?.coordinates) { return; } - popup.setLngLat(popupData?.coordinates).addTo(map); + popup.setLngLat(popupData?.coordinates); + if (!popup.isOpen()) { + popup.addTo(map); + } }, [popup, popupData?.coordinates, map]); useEffect(() => {