Skip to content

Commit

Permalink
DBC22-1627
Browse files Browse the repository at this point in the history
  • Loading branch information
fatbird committed Jan 31, 2024
1 parent 924a957 commit b918b74
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/frontend/src/Components/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,22 @@ export default function MapWrapper({

// Click states
const resetClickedStates = (targetFeature) => {
// camera is set to data structure rather than map feature
if (clickedCameraRef.current && !clickedCameraRef.current.setStyle) {
clickedCameraRef.current = mapLayers.current['highwayCams'].getSource().getFeatureById(clickedCameraRef.current.id);
}

if (clickedCameraRef.current && targetFeature != clickedCameraRef.current) {
clickedCameraRef.current.setStyle(cameraStyles['static']);
updateClickedCamera(null);
}

// event is set to data structure rather than map feature
if (clickedEventRef.current && !clickedEventRef.current.ol_uid) {
const features = mapLayers.current[clickedEventRef.current.display_category].getSource();
clickedEventRef.current = features.getFeatureById(clickedEventRef.current.id);
}

if (clickedEventRef.current && targetFeature != clickedEventRef.current) {
clickedEventRef.current.setStyle(
getEventIcon(clickedEventRef.current, 'static'),
Expand Down

0 comments on commit b918b74

Please sign in to comment.