diff options
Diffstat (limited to 'modern/src/map/MapPositions.js')
-rw-r--r-- | modern/src/map/MapPositions.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modern/src/map/MapPositions.js b/modern/src/map/MapPositions.js index 5bff23fb..49639e8d 100644 --- a/modern/src/map/MapPositions.js +++ b/modern/src/map/MapPositions.js @@ -178,7 +178,7 @@ const MapPositions = ({ positions, onClick, showStatus, selectedPosition, titleF }, [mapCluster, clusters, direction, onMarkerClick, onClusterClick]); useEffect(() => { - map.getSource(id).setData({ + map.getSource(id)?.setData({ type: 'FeatureCollection', features: positions.filter((it) => devices.hasOwnProperty(it.deviceId)).map((position) => ({ type: 'Feature', @@ -189,7 +189,7 @@ const MapPositions = ({ positions, onClick, showStatus, selectedPosition, titleF properties: createFeature(devices, position, selectedPosition && selectedPosition.id), })), }); - }, [devices, positions, selectedPosition]); + }, [mapCluster, clusters, direction, onMarkerClick, onClusterClick, devices, positions, selectedPosition]); return null; }; |