Skip to content

Commit

Permalink
support naming and keying transit vehicle overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-grant-ibigroup committed Oct 30, 2024
1 parent cab7c04 commit 2128ad7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/components/map/default-map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,10 @@ 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

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

0 comments on commit 2128ad7

Please sign in to comment.