Summary
In stop + route focus mode, when a background data poll updates route info, the
map camera reframes to fit the whole route — discarding the pan/zoom the rider had
set. Periodic data polls should refresh the data (vehicles, stops, geometry) without
issuing a camera framing. The camera should only move in response to explicit user
navigation (opening a route, re-tapping to snap back, focusing a vehicle), never as a
side effect of a poll.
Steps to reproduce
- Open a route and focus a stop (stop + route focus, showing the route(s) serving that stop).
- Pan/zoom the map somewhere the rider wants to keep (e.g. zoom into the focused stop).
- Wait for the next data poll to land.
Expected
The camera stays put. The poll refreshes vehicles/geometry underneath the current
viewport.
Actual
The camera reframes to the whole route's extent, throwing away the rider's view.
Where it comes from
FramingIntent.Route is a retained framing — MapRenderState._framingIntent is a
replay = 1 SharedFlow, and the camera collector re-applies the last framing to the
current geometry:
render/MapRenderState.kt — _framingIntent (replay = 1); routeFramingPolylines is
refreshed on every setRoutePolylines(...) call (i.e. every publishMapPresentation()).
src/google/.../compose/GoogleComposeAdapter.kt (and the MapLibre equivalent) —
renderState.framingIntent.filterNotNull().collect { applyFramingIntent(...) }, where
FramingIntent.Route fits to renderState.routeFramingPolylines read at apply time.
map/RouteMapController.kt — host.frameRoute() (→ frame(FramingIntent.Route)) plus
the per-publish framingPolylines updates.
So a retained route framing re-applied after a poll-driven republish (or a collector
re-subscription) fits to the freshly-republished whole-route geometry. Framing is
currently coupled to the data-republish path rather than to explicit navigation intent.
Suggested direction
Decouple camera framing from data polls: a poll that only updates route info/geometry
should update routeFramingPolylines (camera state) without causing the camera to
move. Framing should fire only from explicit navigation actions. Guarding this in
stop + route focus specifically (where the rider has usually zoomed into the focused
stop) is the priority.
Context
Related to the recent framing/route-focus work: #1892 (unified route focus rendering)
and #1893 (focus vehicles on exact trip geometry).
Summary
In stop + route focus mode, when a background data poll updates route info, the
map camera reframes to fit the whole route — discarding the pan/zoom the rider had
set. Periodic data polls should refresh the data (vehicles, stops, geometry) without
issuing a camera framing. The camera should only move in response to explicit user
navigation (opening a route, re-tapping to snap back, focusing a vehicle), never as a
side effect of a poll.
Steps to reproduce
Expected
The camera stays put. The poll refreshes vehicles/geometry underneath the current
viewport.
Actual
The camera reframes to the whole route's extent, throwing away the rider's view.
Where it comes from
FramingIntent.Routeis a retained framing —MapRenderState._framingIntentis areplay = 1SharedFlow, and the camera collector re-applies the last framing to thecurrent geometry:
render/MapRenderState.kt—_framingIntent(replay = 1);routeFramingPolylinesisrefreshed on every
setRoutePolylines(...)call (i.e. everypublishMapPresentation()).src/google/.../compose/GoogleComposeAdapter.kt(and the MapLibre equivalent) —renderState.framingIntent.filterNotNull().collect { applyFramingIntent(...) }, whereFramingIntent.Routefits torenderState.routeFramingPolylinesread at apply time.map/RouteMapController.kt—host.frameRoute()(→frame(FramingIntent.Route)) plusthe per-publish
framingPolylinesupdates.So a retained route framing re-applied after a poll-driven republish (or a collector
re-subscription) fits to the freshly-republished whole-route geometry. Framing is
currently coupled to the data-republish path rather than to explicit navigation intent.
Suggested direction
Decouple camera framing from data polls: a poll that only updates route info/geometry
should update
routeFramingPolylines(camera state) without causing the camera tomove. Framing should fire only from explicit navigation actions. Guarding this in
stop + route focus specifically (where the rider has usually zoomed into the focused
stop) is the priority.
Context
Related to the recent framing/route-focus work: #1892 (unified route focus rendering)
and #1893 (focus vehicles on exact trip geometry).