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

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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