ReplayRouteSession

class ReplayRouteSession : MapboxNavigationObserver

Used to create a replay trip session. Continue to use MapboxNavigation.setNavigationRoutes to decide the route that should be replayed.

Do not use this class with the ReplayProgressObserver. They will create conflicts with and the results are undefined.

The simulated driver from ReplayRouteSession will slow down to a stop depending ReplayRouteSessionOptions.decodeMinDistance. To remove this behavior you can set it to Double.MAX_VALUE, be aware that it will require more memory.

Use ReplayRouteSessionOptions for customizations. For example, this is how can update the location frequency.

replayRouteSession.setOptions(
replayRouteSession.getOptions().toBuilder()
.replayRouteOptions(
replayRouteSession.getOptions().replayRouteOptions.toBuilder()
.frequency(25.0)
.build()
)
.build()
)

Enable and disable the ReplayRouteSession with MapboxNavigation or MapboxNavigationApp. The replay session will be enabled when MapboxNavigation is attached.

Constructors

Link copied to clipboard
fun ReplayRouteSession()

Functions

Link copied to clipboard
fun getOptions(): ReplayRouteSessionOptions

Get the options that are currently set. This can be used to change the options.

Link copied to clipboard
open override fun onAttached(mapboxNavigation: MapboxNavigation)

Signals that the mapboxNavigation instance is ready for use. Use this function to register mapboxNavigation observers, such as MapboxNavigation.registerRoutesObserver.

Link copied to clipboard
open override fun onDetached(mapboxNavigation: MapboxNavigation)

Signals that the mapboxNavigation instance is being detached. Use this function to unregister mapboxNavigation observers that were registered in onAttached.

Link copied to clipboard
fun setOptions(options: ReplayRouteSessionOptions): ReplayRouteSession

Set new options for the ReplayRouteSession. This will not effect previously simulated events, the end behavior will depend on the values you have used. If you want to guarantee the effect of the options, you need to set options before MapboxNavigation is attached.