requestRoutes
Requests a route using the available Router implementation.
Use MapboxNavigation.setRoutes 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 : RouterCallback {
override fun onRoutesReady(routes: List<DirectionsRoute>) {
...
mapboxNavigation.setRoutes(routes)
}
...
})
Return
requestId, see cancelRouteRequest
See also
Parameters
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.)
listener that gets notified when request state changes
Requests a route using the available NavigationRouter implementation.
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)
}
...
})
Return
requestId, see cancelRouteRequest
See also
Parameters
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.)
listener that gets notified when request state changes