CarRouteLineRendererOptions

Defines how CarRouteLineRenderer builds the route line and upcoming-maneuver arrow rendering components.

Each option is a factory rather than a fixed instance, given the MapboxCarMapSurface, because MapboxRouteLineViewOptions and RouteArrowOptions both need a live CarContext and/or Style to build, and those are only available once the car map surface has attached.

MapboxCarMapSurface does not carry the loaded style directly; read it through mapboxCarMapSurface.mapSurface.mapboxMap.style, which returns null until the style has finished loading. CarRouteLineRenderer only invokes these providers once its own style observation has already seen the style load, so in practice the style is present by the time a provider runs; a provider should still treat null defensively (for example by falling back to a sensible default) rather than assuming the non-null contract another caller might not honor.

See also

Types

Link copied to clipboard
class Builder

Builds CarRouteLineRendererOptions instances.

Properties

Link copied to clipboard
val routeArrowApiProvider: (MapboxCarMapSurface) -> MapboxRouteArrowApi

Builds the MapboxRouteArrowApi used to calculate the upcoming maneuver arrow, given the attached MapboxCarMapSurface.

Link copied to clipboard
val routeArrowOptionsProvider: (MapboxCarMapSurface) -> RouteArrowOptions

Builds the RouteArrowOptions used to draw the upcoming maneuver arrow, given the attached MapboxCarMapSurface. Use this to customize the arrow icon pack (for example RouteArrowOptions.Builder.withArrowHeadIconDrawable and RouteArrowOptions.Builder.withArrowHeadIconCasingDrawable) and its colors (for example RouteArrowOptions.Builder.withArrowColor and RouteArrowOptions.Builder.withArrowCasingColor).

Link copied to clipboard

Builds the MapboxRouteLineApiOptions used to calculate the route line, given the attached MapboxCarMapSurface. Defaults to a vanishing route line.

Link copied to clipboard

Builds the MapboxRouteLineViewOptions used to draw the route line, given the attached MapboxCarMapSurface. Use this to customize the route line appearance, including its RouteLineColorResources.