Skip to content

Commit

Permalink
DBC22-2256: disabled layers no longer load in cam details page
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-oxd committed May 29, 2024
1 parent a525766 commit 522b140
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions src/frontend/src/Components/map/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,34 +322,42 @@ export default function DriveBCMap(props) {

// Ferries layer
useEffect(() => {
loadLayer(
mapLayers, mapRef, mapContext,
'inlandFerries', filteredFerries, 68
);
if (!isCamDetail) {
loadLayer(
mapLayers, mapRef, mapContext,
'inlandFerries', filteredFerries, 68
);
}
}, [filteredFerries]);

// Current weathers layer
useEffect(() => {
loadLayer(
mapLayers, mapRef, mapContext,
'weather', filteredCurrentWeathers, 66
);
if (!isCamDetail) {
loadLayer(
mapLayers, mapRef, mapContext,
'weather', filteredCurrentWeathers, 66
);
}
}, [filteredCurrentWeathers]);

// Regional weathers layer
useEffect(() => {
loadLayer(
mapLayers, mapRef, mapContext,
'regional', filteredRegionalWeathers, 67
);
if (!isCamDetail) {
loadLayer(
mapLayers, mapRef, mapContext,
'regional', filteredRegionalWeathers, 67
);
}
}, [filteredRegionalWeathers]);

// Rest stops layer
useEffect(() => {
loadLayer(
mapLayers, mapRef, mapContext,
'restStops', filteredRestStops, 68
);
if (!isCamDetail) {
loadLayer(
mapLayers, mapRef, mapContext,
'restStops', filteredRestStops, 68
);
}
}, [filteredRestStops]);

// Advisories layer
Expand Down Expand Up @@ -393,7 +401,7 @@ export default function DriveBCMap(props) {
<button
className="close-panel"
aria-label={`${openPanel ? 'close side panel' : ''}`}
aria-labelledby="button-close-side-panel-label"
aria-labelledby="button-close-side-panel-label"
aria-hidden={`${openPanel ? false : true}`}
tabIndex={`${openPanel ? 0 : -1}`}
onClick={() => togglePanel(panel, resetClickedStates, clickedFeatureRef, updateClickedFeature)}>
Expand Down

0 comments on commit 522b140

Please sign in to comment.