Repository navigation
Add NavigationView (NavigationViewController on iOS, UI components on Android) - #1
Merged
Merged
Conversation
The navigator first matched a new route against the previous trip session's last location, extrapolated by the time since. Simulated guidance could start at 100% progress and report an arrival, then arrive again. Reset the trip session before setting the routes and starting the replay.
Under the activity's lifecycle the Maps lifecycle plugin keeps every MapView and its renderer alive until the activity is destroyed, about 370 MB per NavigationView on an emulator. Give the map its own lifecycle, as @rnmapbox/maps does for its maps.
The WeakHashMap's value, the binding, references its key, so navigation maps were never collected.
The example counts arrival events.
The view controller's mute button only reflected its own taps. The SDK keeps the button internal; it's found as the floating button with a selected image.
mfazekas
force-pushed
the
feat/navigation-view
branch
from
October 20, 2026 22:18
c0ef1f8 to
0836ccd
Compare
The SDK's simulator only re-seeds when the route length changes, and the replacement simulator arrives after guidance has started, deriving its position from progress matched against the previous simulation's location. Restarting a route after arriving began at 0 m and reported an arrival. Seed the simulation with the route's origin, and start guidance once the SDK has swapped in the new location client.
mfazekas
force-pushed
the
feat/navigation-view
branch
from
October 20, 2026 22:54
af47cdc to
e319cd8
Compare
mfazekas
marked this pull request as ready for review
October 20, 2026 23:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
<NavigationView>, a full-screen "route from A to B and navigate" UI next to the headless API. On iOS it embedsMapboxNavigationUIKit'sNavigationViewControlleras a child view controller. On Android it's an equivalent built from the Navigation SDK v3ui-componentson a plain MapboxMapView: maneuver banner, speed limit, trip progress, mute, overview, recenter and end buttons, route line with the maneuver arrow, puck and navigation camera.Fabric props can't carry host objects, so the JS component passes a numeric
routeIdfrom a newgetRouteId(route)binding, and native views resolve it through a C++ registry of live routes. The view uses the shared navigation session: mounting it, or passing a new route, replaces any active guidance; unmounting it or the end button stops guidance. Module route-progress events also report its guidance. On Android the guidance start/stop logic moved from the module intoRNMBXNavigationSessionso both callers share it.Changes in this pass:
OFF_ROUTE, then a jump back to the start; with a longer gap it lands past the destination). The session now callsresetTripSessionand only sets the routes and starts the replay in its callback. After the fix, restarts begin at the full distance with no off-route.NavigationView'sMapViewalive until the activity was destroyed (~370 MB per visit on the emulator). The view now gives its map its own lifecycle, as@rnmapbox/mapsdoes. Separately,RNMBXNavigationMapFactory.bindings(from main) was aWeakHashMapwhose value referenced its key, so navigation maps were never collected. Views and PSS now stay flat across cycles.apply(coreConfig:)arrives two main-actor turns after guidance starts.prepareActiveGuidancenow seeds the simulation with the route's origin and waits for the swap before guidance starts, on both the headless and the NavigationView path.mute. The SDK keeps it internal, so it's found amongfloatingButtonsas the one with a selected image. The state is re-applied afterviewWillAppear, which otherwise resets it.Tested on the iOS simulator and the Android emulator with the "NavigationView" example screen, which now counts arrival events: guidance with banner and progress, one arrival per run, clean restarts after an arrival,
mutetoggles in sync with the SDK button in both directions, and repeated open/close.Android still has no end-of-route, feedback or alternative-route UI, no day/night styles, no road name label, and doesn't show reroutes as such. These are listed in the README.