MapboxTripStarter

class MapboxTripStarter : MapboxNavigationObserver

The MapboxTripStarter makes it simpler to switch between a trip session and replay.

This is not able to observe when location permissions change, so you may need to refresh the state with refreshLocationPermissions. Location permissions are not required for replay.

There should be one instance of this class at a time. For example, an app Activity and car Session will need to use the same instance. That will be done automatically if you use getRegisteredInstance.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun enableMapMatching(): MapboxTripStarter

This is the default mode for the MapboxTripStarter. This can be used to disable enableReplayRoute. Make sure location permissions have been accepted or this will have no effect on the experience.

Link copied to clipboard
fun enableReplayHistory(options: ReplayHistorySessionOptions? = null): MapboxTripStarter

Enables a mode where history files will be replayed. Set an absolute path to the history file in the options. Use MapboxNavigation.historyRecorder to get an instance of the MapboxHistoryRecorder to record a history file.

Link copied to clipboard
fun enableReplayRoute(options: ReplayRouteSessionOptions? = null): MapboxTripStarter

Enables a mode where the primary route is simulated by an artificial driver. Set the route with MapboxNavigation.setNavigationRoutes. Can be used with getReplayRouteSessionOptions to make minor adjustments to the current options.

Link copied to clipboard

Get the current ReplayHistorySessionOptions. This can be used with enableReplayHistory to make minor adjustments to the current options.

Link copied to clipboard

Get the current ReplayRouteSessionOptions. This can be used with enableReplayRoute to make minor adjustments to the current options.

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

Signals that the mapboxNavigation instance is ready for use.

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

Signals that the mapboxNavigation instance is being detached.

Link copied to clipboard
fun refreshLocationPermissions(): MapboxTripStarter

enableMapMatching will not work unless location permissions have been granted. Refresh the location permissions after they are granted to ensure the trip session will start.