Skip to content

Commit

Permalink
fix: Only add popup if not opened
Browse files Browse the repository at this point in the history
  • Loading branch information
josebui committed Sep 7, 2023
1 parent f1d0b89 commit 7ec5c24
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sharedData/visualization/components/Visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit 7ec5c24

Please sign in to comment.