Skip to content

Commit 17cc21d

Browse files
fatbirdminORC
authored andcommitted
DBC22-2776 Event panel replaced by route panel
1 parent c9ee261 commit 17cc21d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/frontend/src/Components/map/Map.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ export default function DriveBCMap(props) {
400400

401401
loadLayer(
402402
mapLayers, mapRef, mapContext,
403-
'routeLayer', dl, dl, 3, null, updateReferenceFeature
403+
'routeLayer', dl, dl, 3, referenceData, updateReferenceFeature
404404
);
405405

406406
if (selectedRoute && selectedRoute.routeFound) {
@@ -589,7 +589,8 @@ export default function DriveBCMap(props) {
589589

590590
<div className="panel-content">
591591
{openPanel && (
592-
(selectedRoute && selectedRoute.routeFound) && renderPanel(clickedFeature, null, {...routeDetails, ferries: selectedFerries, distance: routeDistance, distanceUnit: routeDistanceUnit}, smallScreen, mapView)
592+
(selectedRoute && selectedRoute.routeFound)
593+
&& renderPanel(clickedFeature, null, {...routeDetails, ferries: selectedFerries, distance: routeDistance, distanceUnit: routeDistanceUnit}, smallScreen, mapView)
593594
)}
594595

595596
{openPanel && (

src/frontend/src/Components/map/layers/routeLayer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export function getRouteLayer(routeData, projectionCode, mapContext, referenceDa
3535
projectionCode,
3636
);
3737

38-
updateReferenceFeature(olFeatureForMap);
38+
if (!referenceData.type) { // if there's no feature specified in the URL
39+
updateReferenceFeature(olFeatureForMap);
40+
}
3941

4042
const centroidGeometry = new Point(
4143
olFeature.getGeometry().getCoordinates()[

0 commit comments

Comments
 (0)