Skip to content

Add route snapping using OSRM - #85

Draft
konewka17 wants to merge 4 commits into
masterfrom
claude/osrm-route-snapping-ezxg68
Draft

Add route snapping using OSRM#85
konewka17 wants to merge 4 commits into
masterfrom
claude/osrm-route-snapping-ezxg68

Conversation

@konewka17

Copy link
Copy Markdown
Owner

See #82

claude added 4 commits June 14, 2026 10:22
Snaps raw GPS traces to the road network via the public OSRM match
endpoint when snap_to_road is enabled. Results are cached in localStorage
and applied progressively — raw polylines show immediately, each segment
updates as its snapped route arrives, mirroring the reverse geocoding pattern.

https://claude.ai/code/session_014gh3vpxy9ZNMT75MAdFFph
The public OSRM demo server enforces a low max_matching_size that rejects
requests with more than ~10 trace coordinates (returns TooBig error).
OSRM still returns a full road-following geometry with overview=full even
from just 10 evenly-spaced sample points, so snapping quality is unaffected
for typical trips.

https://claude.ai/code/session_014gh3vpxy9ZNMT75MAdFFph
_drawMapPaths() previously called _fitMapToCurrentMode() unconditionally,
causing the map to re-zoom every time a background update (OSRM snapping,
reverse geocoding) triggered a re-render. Fix by gating the fit behind a
_mapFitPending flag that is set by navigation events (_resetMapFitMode,
entity switch) and consumed once by the next draw. Progressive updates call
_render() but never set the flag, so the user's map position is preserved.

https://claude.ai/code/session_014gh3vpxy9ZNMT75MAdFFph
@konewka17 konewka17 mentioned this pull request Jun 28, 2026
@konewka17
konewka17 marked this pull request as draft July 26, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants