diff options
Diffstat (limited to 'modern/src/map/MapMarkers.js')
-rw-r--r-- | modern/src/map/MapMarkers.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modern/src/map/MapMarkers.js b/modern/src/map/MapMarkers.js index 8bcfd8d6..8fbe92b6 100644 --- a/modern/src/map/MapMarkers.js +++ b/modern/src/map/MapMarkers.js @@ -67,7 +67,7 @@ const MapMarkers = ({ markers, showTitles }) => { }, [showTitles]); useEffect(() => { - map.getSource(id).setData({ + map.getSource(id)?.setData({ type: 'FeatureCollection', features: markers.map(({ latitude, longitude, image, title }) => ({ type: 'Feature', @@ -81,7 +81,7 @@ const MapMarkers = ({ markers, showTitles }) => { }, })), }); - }, [markers]); + }, [showTitles, markers]); return null; }; |