WELIFE Docs Swagger Admin Web

WP-FE-ROUTE-NAV-COMPASS-01 — Navigation GPS + compass (Google-Maps-like)

Domain: D-ROUTE · Surface: CON · Status: IMP · Date: 2026-08-13

Goal

Màn RouteActive theo dõi vị trí + la bàn liên tục, căn camera/heading theo lộ trình (giống Google Maps turn-by-turn).

Acceptance

AC Result
GPS watch ~ mỗi 3s (timeInterval + BestForNavigation) PASS
La bàn watchHeadingAsync (trueHeading / magHeading) PASS
Snap GPS → polyline; remaining dọc tuyến; off-route >45m PASS
Camera follow: animateCamera heading + pitch; chevron user PASS
Heading ưu tiên: GPS course khi chạy · compass khi đứng · segment bearing PASS

Files

Path Change
mobile/src/features/places/useDeviceLocation.ts timeIntervalMs default 3s · compassHeading · heading watch
mobile/src/features/routing/routeSnap.ts snapToRoute · bearingDeg · resolveNavHeading
mobile/src/features/routing/components/RoutePolylinePreview.tsx follow camera · traversed polyline · chevron · fill
mobile/src/features/routing/screens/RouteActiveScreen.tsx wire snap + heading + off-route banner

Out of scope

Verify local

  1. Expo Go / device thật (compass cần hardware).
  2. Chỉ đường → Bắt đầu → RouteActive.
  3. Xoay máy: camera + mũi tên xoay; GPS hint cập nhật ~3s.
  4. Lệch tuyến >45m → banner “Quay lại lộ trình”.