Skip to content

Commit

Permalink
Merge pull request #1297 from opentripplanner/route-vehicles-overlay-…
Browse files Browse the repository at this point in the history
…name-override

Support naming and keying transit vehicle overlay
  • Loading branch information
miles-grant-ibigroup authored Nov 25, 2024
2 parents a9ce15f + 0a062eb commit bad8e44
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/components/map/default-map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ class DefaultMap extends Component {
const baseLayerUrls = baseLayersWithNames?.map((bl) => bl.url)
const baseLayerNames = baseLayersWithNames?.map((bl) => bl.name)

const routeBasedTransitVehicleOverlayNameOverride =
overlays?.find((o) => o.type === 'vehicles-one-route')?.name || undefined

return (
<MapContainer className="percy-hide">
<BaseMap
Expand All @@ -342,7 +345,13 @@ class DefaultMap extends Component {
{/* The default overlays */}
<EndpointsOverlay />
<RouteViewerOverlay />
<TransitVehicleOverlay ModeIcon={ModeIcon} />
<TransitVehicleOverlay
id={routeBasedTransitVehicleOverlayNameOverride}
key={routeBasedTransitVehicleOverlayNameOverride}
ModeIcon={ModeIcon}
name={routeBasedTransitVehicleOverlayNameOverride}
visible
/>
<GeolocateControl
onGeolocate={() => {
getCurrentPosition(intl)
Expand Down

0 comments on commit bad8e44

Please sign in to comment.