setNavigationRouteLines

suspend fun MapboxRouteLineApi.setNavigationRouteLines(newRoutes: List<NavigationRouteLine>): Expected<RouteLineError, RouteSetValue>

Sets the routes that will be operated on.

Return

a state which contains the side effects to be applied to the map

Parameters

newRoutes

one or more routes. The first route in the collection will be considered the primary route and any additional routes will be alternate routes.


suspend fun MapboxRouteLineApi.setNavigationRouteLines(newRoutes: List<NavigationRouteLine>, activeLegIndex: Int): Expected<RouteLineError, RouteSetValue>

Sets the routes that will be operated on.

Return

a state which contains the side effects to be applied to the map

Parameters

newRoutes

one or more routes. The first route in the collection will be considered

activeLegIndex

the index of the currently active leg of the primary route. This is used when MapboxRouteLineOptions.styleInactiveRouteLegsIndependently is enabled. the primary route and any additional routes will be alternate routes.


suspend fun MapboxRouteLineApi.setNavigationRouteLines(newRoutes: List<NavigationRouteLine>, alternativeRoutesMetadata: List<AlternativeRouteMetadata>): Expected<RouteLineError, RouteSetValue>

Sets the routes that will be operated on.

Return

a state which contains the side effects to be applied to the map

Parameters

newRoutes

one or more routes. The first route in the collection will be considered the primary route and any additional routes will be alternate routes.

alternativeRoutesMetadata

if available, the update will hide the portions of the alternative routes until the deviation point with the primary route. See MapboxNavigation.getAlternativeMetadataFor.


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

Sets the routes that will be operated on.

Return

a state which contains the side effects to be applied to the map

Parameters

newRoutes

one or more routes. The first route in the collection will be considered the primary route and any additional routes will be alternate routes.

activeLegIndex

the index of the currently active leg of the primary route. This is used when MapboxRouteLineOptions.styleInactiveRouteLegsIndependently is enabled.

alternativeRoutesMetadata

if available, the update will hide the portions of the alternative routes until the deviation point with the primary route. See MapboxNavigation.getAlternativeMetadataFor.