Builder

class Builder(context: Context)

A builder used to create instance of MapboxRouteLineViewOptions.

Parameters

context

context

Constructors

Link copied to clipboard
fun Builder(context: Context)

Functions

Link copied to clipboard
fun build(): MapboxRouteLineViewOptions

Creates an instance of MapboxRouteLineViewOptions.

Link copied to clipboard
fun destinationWaypointIcon(@DrawableRes destinationWaypointIcon: Int): MapboxRouteLineViewOptions.Builder

The drawable id for representing the destination icon.

Link copied to clipboard
fun displayRestrictedRoadSections(displayRestrictedRoadSections: Boolean): MapboxRouteLineViewOptions.Builder

Indicates if the route line will display restricted road sections with a dashed line. Note that in order for restricted sections to be displayed, you also need to set MapboxRouteLineApiOptions.calculateRestrictedRoadSections to true, so that the necessary data is calculated. You can have a set-up when some of your MapboxRouteLineViews display the restricted sections and the other don't. I that case set MapboxRouteLineViewOptions.displayRestrictedRoadSections to true for those views that will display restricted sections and set MapboxRouteLineApiOptions.calculateRestrictedRoadSections to true if at least one of your views will display them.

Link copied to clipboard
fun displaySoftGradientForTraffic(displaySoftGradientForTraffic: Boolean): MapboxRouteLineViewOptions.Builder

Determines if the color transition between traffic congestion changes should use a soft gradient appearance or abrupt color change. This is false by default.

Link copied to clipboard
fun iconPitchAlignment(iconPitchAlignment: IconPitchAlignment): MapboxRouteLineViewOptions.Builder

The pitch alignment value used for waypoint icons. The default is IconPitchAlignment.MAP.

Link copied to clipboard
fun lineDepthOcclusionFactor(@FloatRange(from = 0.0, to = 1.0) lineDepthOcclusionFactor: Double): MapboxRouteLineViewOptions.Builder

Factor that decreases line layer opacity based on occlusion from 3D objects. Value 0 disables occlusion, value 1 means fully occluded.

Link copied to clipboard
fun originWaypointIcon(@DrawableRes originWaypointIcon: Int): MapboxRouteLineViewOptions.Builder

The drawable id for representing the origin icon.

Link copied to clipboard
fun restrictedRoadDashArray(restrictedRoadDashArray: List<Double>): MapboxRouteLineViewOptions.Builder

The dash array for the LineLayer used for displaying restricted roads.

Link copied to clipboard
fun restrictedRoadLineWidth(restrictedRoadLineWidth: Double): MapboxRouteLineViewOptions.Builder

The width of the restricted road LineLayer.

Link copied to clipboard
fun restrictedRoadOpacity(restrictedRoadOpacity: Double): MapboxRouteLineViewOptions.Builder

The opacity of the restricted road LineLayer.

Link copied to clipboard
fun routeLineBelowLayerId(layerId: String?): MapboxRouteLineViewOptions.Builder

Determines the elevation of the route layers. Note that if you are using Mapbox Standard style, you can only specify a layer id that is added at runtime: static layer ids from the style will not be applied.

Link copied to clipboard
fun routeLineColorResources(routeLineColorResources: RouteLineColorResources): MapboxRouteLineViewOptions.Builder

An instance of RouteLineColorResources. Contains information about colors used for route line.

Link copied to clipboard
fun scaleExpressions(scaleExpressions: RouteLineScaleExpressions): MapboxRouteLineViewOptions.Builder

An instance of RouteLineScaleExpressions. Contains information about custom scaling expressions.

Link copied to clipboard
fun shareLineGeometrySources(shareLineGeometrySources: Boolean): MapboxRouteLineViewOptions.Builder

Enable route line's GeoJson source data sharing between multiple instances of the map. If this option is enabled for multiple instances of MapboxRouteLineViews that are used to draw route lines on multiple maps at the same time, they will all share the GeoJson source to optimize execution time of updates and decrease the memory footprint. Enable only for instances that should share the geometry of the lines, leave disabled for instances that should draw geometries distinct from other instances.

Link copied to clipboard
fun softGradientTransition(softGradientTransition: Double): MapboxRouteLineViewOptions.Builder

Influences the length of the color transition when the displaySoftGradientForTraffic parameter is true.

Link copied to clipboard
fun tolerance(tolerance: Double): MapboxRouteLineViewOptions.Builder

The tolerance value used when configuring the underlying map source.

Link copied to clipboard
fun waypointLayerIconAnchor(waypointLayerIconAnchor: IconAnchor): MapboxRouteLineViewOptions.Builder

The anchor value, the default is IconAnchor.CENTER.

Link copied to clipboard
fun waypointLayerIconOffset(waypointLayerIconOffset: List<Double>): MapboxRouteLineViewOptions.Builder

The list of offset values for waypoint icons.