MapboxManeuverApi

Mapbox Maneuver Api allows you to request Maneuver instructions given a DirectionsRoute (to get all maneuvers for the provided route) or RouteProgress (to get remaining maneuvers for the provided route).

Constructors

Link copied to clipboard
constructor(formatter: DistanceFormatter, maneuverOptions: ManeuverOptions = ManeuverOptions.Builder().build(), routeShieldApi: MapboxRouteShieldApi = MapboxRouteShieldApi())

Mapbox Maneuver Api allows you to request Maneuver instructions given a DirectionsRoute (to get all maneuvers for the provided route) or RouteProgress (to get remaining maneuvers for the provided route).

Functions

Link copied to clipboard
fun cancel()

Invoke the function to cancel any job invoked through other APIs

Link copied to clipboard
fun getManeuvers(routeProgress: RouteProgress): Expected<ManeuverError, List<Maneuver>>
fun getManeuvers(route: NavigationRoute, routeLegIndex: Int? = null): Expected<ManeuverError, List<Maneuver>>

Returns a list of Maneuvers which are wrappers on top of BannerInstructions that are in the provided route.

Link copied to clipboard
fun getRoadShields(maneuvers: List<Maneuver>, shieldCallback: RouteShieldCallback)

Given a list of Maneuver the function requests legacy road shields (if available) using BannerComponents.imageBaseUrl associated in RoadShieldComponentNode.

fun getRoadShields(userId: String?, styleId: String?, maneuvers: List<Maneuver>, shieldCallback: RouteShieldCallback)

Given a list of Maneuver the function requests mapbox designed road shields (if available) using BannerComponents.mapboxShield associated in RoadShieldComponentNode. If for any reason the API fails to download the mapbox designed shields, it fallbacks to use legacy BannerComponents.imageBaseUrl if available.