Skip to content

Fill headless API gaps and add RNNavigationView - #2

Merged
mfazekas merged 4 commits into
feat/navigation-viewfrom
feat/rn-navigation-view
Oct 21, 2026
Merged

mfazekas merged 4 commits into
feat/navigation-viewfrom
feat/rn-navigation-view

Conversation

@mfazekas

@mfazekas mfazekas commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #1. Fills the gaps in the headless API and adds <RNNavigationView>, a navigation UI written in React Native on top of it, to check that the low-level API is enough to rebuild <NavigationView>.

API additions, same shapes on both platforms:

  1. Banner data on route progress: secondaryInstruction, subInstruction, lanes (indications, valid, activeDirection), legIndex, stepIndex. Route legs get steps (instruction, distance, duration, maneuver type/modifier, road name). <NavigationView>'s onRouteProgress has the same fields.
  2. Events: addLocationListener (snapped location, speed, course, road name, speed limit with unit and sign standard), addArriveListener, addOffRouteListener, and addRouteChangeListener, which hands JS a new Route host object on reroute or a switch to an alternative; the old one stays valid until released.
  3. Voice: the SDK speech player now speaks during any guidance, shared with <NavigationView>; setVoiceMuted / isVoiceMuted, and addVoiceInstructionListener (text, SSML) for apps doing their own TTS. On Android the player moved from NavigationView into the session.
  4. Maneuver arrow on navigation maps: already drawn by NavigationMapView on iOS; on Android it moved from NavigationView into the shared map binding. Camera control stays setCameraState.

The Navigation object moved to src/Navigation.ts so the view can use it without an import cycle.

The example app has a new "RNNavigationView" screen next to the headless demo and "NavigationView". It runs a city route or one over the Bay Bridge (lanes, speed limits), simulated or on the device location, and logs arrival, off-route, reroute and voice events.

Changes in this pass:

  1. Rebased on the updated Add NavigationView (NavigationViewController on iOS, UI components on Android) #1. The @rnmapbox/maps peer and dev dependency are now on main, so they're gone from this diff. The README additions are folded into the new structure.
  2. The Android arrival fix moved down to Add NavigationView (NavigationViewController on iOS, UI components on Android) #1. The once-per-guidance guard for the session's arrival observer and the off-route de-duplication are folded into the events commit. The spurious off-route at start was the stale-location start that Add NavigationView (NavigationViewController on iOS, UI components on Android) #1 fixes.
  3. iOS mute now lives in the session (voiceMuted, published). NavigationViewController's mute button follows it, including setVoiceMuted from JS. Taps on that button write back into the session, so a later restart keeps the user's choice.
  4. Trimmed the comments.

Verified locally, since CI doesn't run on a PR against #1's branch: lint, typecheck, 28 unit tests, and iOS and Android example builds. A throwaway draft PR to main (#8, closed) ran CI on this head: all four jobs green. Lint needed one rerun because a partial yarn cache hit skips the env.json step; that's a gap in main's CI, not in this PR.

On the iOS simulator and an Android emulator: RNNavigationView shows the route, banner, lanes, speed limit and trip progress, voice instructions are logged, mute toggles, a pan switches the button to Recenter and Recenter brings back following, and arrival fires once. Restarting after an arrival starts at the full distance on both. NavigationView mute stays in sync with the SDK button and setVoiceMuted.

Still missing compared with <NavigationView>: road shields and junction views in the banner, sub-maneuver icons, alternative routes on the map during guidance, feedback, day/night styles, and units other than metric in the view's own formatting. Lanes aren't included in Route steps.

@mfazekas
mfazekas force-pushed the feat/navigation-view branch from c0ef1f8 to 0836ccd Compare October 20, 2026 22:18
@mfazekas
mfazekas force-pushed the feat/rn-navigation-view branch from f70ea27 to 172005e Compare October 20, 2026 22:55
@mfazekas
mfazekas marked this pull request as ready for review October 20, 2026 23:04
@mfazekas
mfazekas merged commit 27178f7 into feat/navigation-view Oct 21, 2026
7 of 8 checks passed
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.

1 participant