Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support naming and keying transit vehicle overlay #1297

Merged
merged 6 commits into from
Nov 25, 2024
Merged
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}
miles-grant-ibigroup marked this conversation as resolved.
Show resolved Hide resolved
key={routeBasedTransitVehicleOverlayNameOverride || undefined}
ModeIcon={ModeIcon}
name={routeBasedTransitVehicleOverlayNameOverride || undefined}
visible
/>
<GeolocateControl
onGeolocate={() => {
getCurrentPosition(intl)
Expand Down
Loading