Repository navigation
feat: next waypoint, simulation speed and voice volume - #30
Merged
Merged
Conversation
…otype) Adds Navigation.advanceToNextLeg, setAutoAdvanceLegs, setSimulationSpeed and setVoiceVolume on iOS and Android, with controls on the RNNavigationView example screen. iOS simulates with its own route simulator, since the SDK's speed multiplier isn't public.
… legs Uses RNMBXNavigationSimulator only at another speed or with manual leg advancing, and switches between the two mid-route. Simulated locations report the route's speed on both platforms.
Switching between the SDK's simulator and ours applies a new core config, which replaces the speech synthesizer; wait until it stops speaking. Documents the reroutes when skipping a leg mid-way and at 4× and above, and drops 8× from the example.
mfazekas
marked this pull request as ready for review
October 28, 2026 20:08
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 advancing to the next waypoint, simulation speed and voice volume, which ATOMIQTECH and Google's SDK offer (competitor report items 6, 7 and 11; homee #69, #83, #50; pawan-pk #25).
They are process-wide setters like
setVoiceMuted, so they also apply to<NavigationView>and<RNNavigationView>. The RNNavigationView example screen gets a "Next stop: on arrival / manual" toggle, a two-stop route (Ferry Building, then Treasure Island) and Next stop / speed (1×, 2×, 4×) / volume chips.How it works:
CoreConfig.multilegAdvancing = .manually { autoAdvanceLegs }andswitchLeg; Android anArrivalControllerreturningautoAdvanceLegsandnavigateNextRouteLeg. Both SDKs ask once per arrival, so turning auto-advance on while waiting at a waypoint doesn't move on.MapboxReplayer.playbackSpeed. On iOS the SDK's simulator speed is internal, so at 1× with auto-advance (the default) iOS simulates with the SDK'sLocationSource.simulationexactly as before. At another speed or with manual advancing,RNMBXNavigationSimulatordrives guidance as a custom location source. Changing either mid-route swaps the source and carries on from the current location; the swap waits while an instruction is spoken, since it replaces the speech synthesizer.MapboxVoiceInstructionsPlayer.volume, iOSspeechSynthesizer.volume = .override(v). The iOS system voice fallback (e.g. offline) ignores it.Verified:
yarn lint,typecheck,test,docs, and a device pass on the iOS simulator and an Android emulator, simulated, on the RNNavigationView screen. Auto-advance continues past the Ferry Building on its own at 1×, 2× and 4× on both platforms; the single-stop route arrives normally, and iOS at 1× matches a build with the SDK's default advancing. Manual mode waits at the stop until "Next stop". Speed changes apply mid-route, and the simulation keeps moving while the map is panned. Volume and mute apply on both, and are re-applied on iOS after a simulator swap (checked in logs; devices were muted).Limitations: