Skip to content

Commit 478e1e7

Browse files
committed
Always render the selected route on map
Always display the selected route if it's not in the displayedRouteIds Previously this would lead to newly created route not being visible until the user starts editing the route
1 parent 53a4d58 commit 478e1e7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

ui/src/components/map/routes/Routes.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ const RoutesImpl: ForwardRefRenderFunction<RouteEditorRef, RoutesProps> = (
2929
const hasDraftRouteGeometry = useAppSelector(selectHasDraftRouteGeometry);
3030
const { drawingMode } = useAppSelector(selectMapRouteEditor);
3131

32+
const renderedRouteIds = selectedRouteId
33+
? Array.from(new Set([...displayedRouteIds, selectedRouteId]))
34+
: displayedRouteIds;
35+
3236
return (
3337
<>
3438
<EditRouteMetadataLayer />
@@ -44,7 +48,7 @@ const RoutesImpl: ForwardRefRenderFunction<RouteEditorRef, RoutesProps> = (
4448
paint={{}}
4549
/>
4650
{showRoute &&
47-
displayedRouteIds.map((item) => (
51+
renderedRouteIds.map((item) => (
4852
<ExistingRouteGeometryLayer
4953
key={item}
5054
routeId={item}

0 commit comments

Comments
 (0)