MapboxRouteLineApiExtensions

Extension functions for MapboxRouteLineApi calls that are implemented as callbacks. This offers an alternative to those callbacks by providing Kotlin oriented suspend functions.

Functions

Link copied to clipboard

Clears the route line data.

Link copied to clipboard
suspend fun MapboxRouteLineApi.findClosestRoute(target: Point, mapboxMap: MapboxMap, padding: Float): Expected<RouteNotFound, ClosestRouteValue>

The map will be queried for a route line feature at the target point or a bounding box centered at the target point with a padding value determining the box's size. If a route feature is found the index of that route in this class's route collection is returned. The primary route is given precedence if more than one route is found.

Link copied to clipboard
Link copied to clipboard
suspend fun MapboxRouteLineApi.setNavigationRouteLines(newRoutes: List<NavigationRouteLine>, activeLegIndex: Int, alternativeRoutesMetadata: List<AlternativeRouteMetadata>): Expected<RouteLineError, RouteSetValue>

Sets the routes that will be operated on.

Link copied to clipboard
suspend fun MapboxRouteLineApi.setNavigationRoutes(newRoutes: List<NavigationRoute>, activeLegIndex: Int): Expected<RouteLineError, RouteSetValue>
suspend fun MapboxRouteLineApi.setNavigationRoutes(newRoutes: List<NavigationRoute>, activeLegIndex: Int, alternativeRoutesMetadata: List<AlternativeRouteMetadata>): Expected<RouteLineError, RouteSetValue>

Sets the routes that will be operated on.