Implement mobile route editor with MapLibre and BRouter routing

Route editing (Phase 3.3):
- useRouteEditor hook: waypoint state, add/move/delete, BRouter
  routing via Journal API proxy, GPX generation, save to API
- RouteMap component: MapLibre Native with OSM raster tiles,
  route polyline (ShapeSource + LineLayer), waypoint markers
  (MarkerView), long-press to add waypoints, computing indicator
- WaypointSheet: bottom sheet for waypoint actions — delete with
  confirmation, overnight stop toggle, coordinates display
- Route detail screen: view mode (map preview + stats) and edit
  mode (full-screen map with save button)
- Unsaved changes guard on navigation (beforeRemove listener)
- Smart waypoint insertion at nearest route segment
- Waypoint extraction from GPX via regex (sync, no DOM needed)

Adds DOM.Iterable to mobile tsconfig for gpx package compat.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-04-13 02:43:00 +02:00
parent 62543cd629
commit bd311cd339
No known key found for this signature in database
GPG key ID: A32FF691A0F752D9
6 changed files with 719 additions and 100 deletions

View file

@ -113,14 +113,14 @@
### 3.3 Route Editing
- [ ] 3.3.1 Implement add-waypoint via long-press on map, inserting at the nearest route segment
- [ ] 3.3.2 Implement drag-to-move for waypoint markers
- [ ] 3.3.3 Implement waypoint deletion with confirmation
- [ ] 3.3.4 Add overnight stop toggle in waypoint detail sheet
- [x] 3.3.1 Implement add-waypoint via long-press on map, inserting at the nearest route segment
- [x] 3.3.2 Implement drag-to-move for waypoint markers
- [x] 3.3.3 Implement waypoint deletion with confirmation
- [x] 3.3.4 Add overnight stop toggle in waypoint detail sheet
- [ ] 3.3.5 Add POI snap suggestions when adding waypoints near known POIs
- [ ] 3.3.6 Integrate BRouter routing via Journal API proxy — recompute route segments on waypoint changes
- [ ] 3.3.7 Implement save: generate GPX from current waypoints + geometry, PUT to Journal API
- [ ] 3.3.8 Add unsaved-changes guard when navigating away from the editor
- [x] 3.3.6 Integrate BRouter routing via Journal API proxy — recompute route segments on waypoint changes
- [x] 3.3.7 Implement save: generate GPX from current waypoints + geometry, PUT to Journal API
- [x] 3.3.8 Add unsaved-changes guard when navigating away from the editor
## Phase 4: Testing