requestRoutes
Requests a route.
Use MapboxNavigation.setNavigationRoutes to supply the returned list of routes, transformed list, or a list from an external source, to be managed by the SDK.
Example:
mapboxNavigation.requestRoutes(routeOptions, object : NavigationRouterCallback {
override fun onRoutesReady(routes: List<NavigationRoute>) {
...
mapboxNavigation.setNavigationRoutes(routes)
}
...
})
Content copied to clipboard
Return
requestId, see cancelRouteRequest
Parameters
routeOptions
params for the route request. Make sure to use the applyDefaultNavigationOptions for the best navigation experience (and to set required request parameters). You can also use applyLanguageAndVoiceUnitOptions get instructions' language and voice unit based on the device's Locale. It's also worth exploring other available options (like enabling alternative routes, specifying destination approach type, defining waypoint types, etc.)
callback
listener that gets notified when request state changes