Skip to content

Commit

Permalink
DBC22-3280: set reference feature to clicked when loading camera deta…
Browse files Browse the repository at this point in the history
…ils page

DBC22-3280: set reference feature to clicked when loading camera details page
  • Loading branch information
bcgov-brwang authored and ray-oxd committed Jan 20, 2025
1 parent daa450a commit ca8d6a5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/frontend/src/Components/map/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,13 @@ export default function DriveBCMap(props) {
updatePosition(feature);
};

const cameraLoationButtonRef = useRef(null);

useEffect(() => {
const interval = setInterval(() => {
if (referenceFeature) {
if (cameraLoationButtonRef.current) {
cameraLoationButtonRef.current.click();
}
referenceFeature.set('clicked', true);
referenceFeature.setStyle(cameraStyles.active);
updateClickedFeature(referenceFeature);
clearInterval(interval);
}
}, 200);
Expand Down Expand Up @@ -809,7 +808,6 @@ export default function DriveBCMap(props) {

{isCamDetail && (
<Button
ref={cameraLoationButtonRef}
className="map-btn cam-location"
variant="primary"
onClick={() => {
Expand Down

0 comments on commit ca8d6a5

Please sign in to comment.