NavigationViewApi

class NavigationViewApi

Api that gives you the ability to change the state for navigation apps.

Functions

Link copied to clipboard
fun enableReplaySession()

Enables replay trip session based on simulated locations.

Link copied to clipboard
fun enableTripSession()

Enables trip session based on real gps updates.

Link copied to clipboard
fun fetchRoutes(options: RouteOptions)

Request routes based on RouteOptions. Routes obtained from this route request can be obtained via NavigationViewListener.onRouteFetching when the route is being fetched NavigationViewListener.onRouteFetchFailed if the route request failed NavigationViewListener.onRouteFetchCanceled if the route request was canceled NavigationViewListener.onRouteFetchSuccessful if the route request was a success

fun fetchRoutes(points: List<Point>)

Request routes based on list of Point. Routes obtained from this route request can be obtained via NavigationViewListener.onRouteFetching when the route is being fetched NavigationViewListener.onRouteFetchFailed if the route request failed NavigationViewListener.onRouteFetchCanceled if the route request was canceled NavigationViewListener.onRouteFetchSuccessful if the route request was a success The first point in the list should be the origin and last point should be the destination. If you have multi waypoints, you can insert additional waypoints in the list between the first and the last point.

Link copied to clipboard
fun isReplayEnabled(): Boolean

Checks if the current trip is being simulated.

Link copied to clipboard
fun setDestination(point: Point)

Sets a destination to NavigationView.

Link copied to clipboard
fun setPreviewRoutes(routes: List<NavigationRoute>)

Sets the routes passed to NavigationView and not to MapboxNavigation. The action does not triggers RouteProgress, BannerInstructions or VoiceInstructions updates even if the TripSessionState is TripSessionState.STARTED.

Link copied to clipboard
fun setRoutes(routes: List<NavigationRoute>)

Sets the routes passed to MapboxNavigation. The action triggers RouteProgress, BannerInstructions and VoiceInstructions updates if the TripSessionState is TripSessionState.STARTED.