aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map/MapRoutePoints.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-03-26 07:08:01 -0700
committerAnton Tananaev <anton@traccar.org>2023-03-26 07:08:01 -0700
commit6402a8a53a9bac2791741c88a84c85c73c53ba91 (patch)
treea55ba45197f7e3d93c212d06d1fb37c83db96da7 /modern/src/map/MapRoutePoints.js
parent4e733fb2d637300196665b377850e7fdbd5ce8eb (diff)
downloadtrackermap-web-6402a8a53a9bac2791741c88a84c85c73c53ba91.tar.gz
trackermap-web-6402a8a53a9bac2791741c88a84c85c73c53ba91.tar.bz2
trackermap-web-6402a8a53a9bac2791741c88a84c85c73c53ba91.zip
Fix map change crash
Diffstat (limited to 'modern/src/map/MapRoutePoints.js')
-rw-r--r--modern/src/map/MapRoutePoints.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/modern/src/map/MapRoutePoints.js b/modern/src/map/MapRoutePoints.js
index 38a0e226..bed81f3a 100644
--- a/modern/src/map/MapRoutePoints.js
+++ b/modern/src/map/MapRoutePoints.js
@@ -55,7 +55,7 @@ const MapPositions = ({ positions, onClick }) => {
}, [onMarkerClick]);
useEffect(() => {
- map.getSource(id).setData({
+ map.getSource(id)?.setData({
type: 'FeatureCollection',
features: positions.map((position, index) => ({
type: 'Feature',
@@ -69,7 +69,7 @@ const MapPositions = ({ positions, onClick }) => {
},
})),
});
- }, [positions]);
+ }, [onMarkerClick, positions]);
return null;
};