Skip to content
Merged
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -598,21 +598,27 @@ class RouteMapController(
focusedGeometry.toRouteBadges(focusedRoutes, routeColors)
} else emptyList()
val selected = selectedTripPresentation()
// A route emphasized inside stop focus carries an adjacency color (keyed on the focused stop's
// trips); the selected trip keeps that color so selecting a vehicle doesn't drop the route back
// to its GTFS hue. In whole-route mode there is no adjacency entry, so fall back to GTFS.
val selectedAdjacencyColor = selected?.let { routeColors[it.routeDirection] }
val selectedTrip = selected?.points
?.takeIf { it.size >= 2 }
?.let { points ->
focusedRoutePolyline(currentRouteColor(), points, directional = true)
focusedRoutePolyline(selectedAdjacencyColor ?: currentRouteColor(), points, directional = true)
}
// A selected vehicle shows its exact trip everywhere: the trip line over its thin
// same-direction underlay (with any focused-stop siblings beneath), framed to that trip,
// and only its scheduled stops. In whole-route mode the empty [focusedGeometry] collapses
// toTripFocusedRoutePolylines to just the underlay + trip.
// A selected vehicle shows its exact trip everywhere: the trip line, framed to that trip, over
// its scheduled stops. In whole-route mode it sits on a thin same-direction underlay; inside
// stop focus the emphasized route already reads via its adjacency color, so the generic
// direction underlay is dropped (it would otherwise look like standalone route mode) and only
// the focused-stop siblings remain beneath the exact trip.
if (selected != null && selectedTrip != null) {
renderState.setRoutePolylines(
polylines = focusedGeometry.toTripFocusedRoutePolylines(
selected.routeDirection,
routeColors,
selectedDirectionUnderlay(selected.routeDirection.directionId),
if (selectedAdjacencyColor != null) emptyList()
else selectedDirectionUnderlay(selected.routeDirection.directionId),
selectedTrip,
),
framingPolylines = listOf(selectedTrip),
Expand Down