You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Map framing does not consistently account for desktop panels, mobile sheets, safe areas, and other visible obstructions. Separately, bearing reset always points north even when aligning with the local street grid would make an urban map easier to read.
Current state
Navigation has dedicated camera padding, while other fitBounds/flyTo calls often use fixed scalar padding.
There is no app-level registry for the actual unobscured map viewport.
resetBearing returns to north; there is no deterministic street-grid orientation estimate or snap behavior.
Proposed solution
Introduce a central map-obstruction/padding service used by every camera/framing operation. Add an optional grid-align action that derives a stable dominant road orientation near the current focus, snaps it with threshold/hysteresis, and always preserves an explicit north-reset action.
Acceptance criteria
Panels, drawers/sheets, navigation chrome, safe areas, and transient controls register their current map obstruction by edge.
The service computes one effective padding rectangle and updates MapLibre padding as layout changes.
Search results, places, routes, transit, imported geometry, offline-area selection, and deep links frame against the effective visible viewport.
Padding transitions are interruptible, avoid feedback loops/jitter, and honor reduced motion.
Mobile sheet detents and desktop panel resize/collapse are covered by layout tests.
Camera ownership rules prevent navigation tracking and a panel transition from fighting each other.
Per-feature padding fixes continue drift. Automatically rotating on every location change is disorienting; grid alignment should be deliberate and confidence-gated.
Problem
Map framing does not consistently account for desktop panels, mobile sheets, safe areas, and other visible obstructions. Separately, bearing reset always points north even when aligning with the local street grid would make an urban map easier to read.
Current state
fitBounds/flyTocalls often use fixed scalar padding.resetBearingreturns to north; there is no deterministic street-grid orientation estimate or snap behavior.Proposed solution
Introduce a central map-obstruction/padding service used by every camera/framing operation. Add an optional grid-align action that derives a stable dominant road orientation near the current focus, snaps it with threshold/hysteresis, and always preserves an explicit north-reset action.
Acceptance criteria
Alternatives considered
Per-feature padding fixes continue drift. Automatically rotating on every location change is disorienting; grid alignment should be deliberate and confidence-gated.
Area
Map camera, layout, navigation, accessibility.
References
apps/web/src/lib/MapContext.tsxapps/web/src/lib/navigation/useNavCamera.tsapps/web/src/components/map/MapControls.tsx