aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map/PositionsMap.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/map/PositionsMap.js')
-rw-r--r--modern/src/map/PositionsMap.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/modern/src/map/PositionsMap.js b/modern/src/map/PositionsMap.js
index 791c7abe..cabce3df 100644
--- a/modern/src/map/PositionsMap.js
+++ b/modern/src/map/PositionsMap.js
@@ -62,7 +62,7 @@ const PositionsMap = ({ positions }) => {
.addTo(map);
}, [history]);
- const onClusterClick = (event) => {
+ const onClusterClick = useCallback((event) => {
const features = map.queryRenderedFeatures(event.point, {
layers: [clusters],
});
@@ -75,7 +75,7 @@ const PositionsMap = ({ positions }) => {
});
}
});
- };
+ }, [clusters]);
useEffect(() => {
map.addSource(id, {
@@ -148,7 +148,7 @@ const PositionsMap = ({ positions }) => {
map.removeSource(id);
}
};
- }, [onMarkerClick]);
+ }, [clusters, onMarkerClick, onClusterClick]);
useEffect(() => {
map.getSource(id).setData({