Builder

class Builder

Responsible for instantiating an instance of MapboxRouteLineOptions

Parameters

context

an instance of Context

routeLineResources

an instance of RouteLineResources

routeLineBelowLayerId

determines the elevation of the route layers

routeStyleDescriptors

a collection of RouteStyleDescriptor objects

vanishingRouteLineEnabled

indicates if the vanishing route line feature is enabled

displayRestrictedRoadSections

indicates if the route line will display restricted road sections with a dashed line

styleInactiveRouteLegsIndependently

enabling this feature will change the color of the route legs that aren't currently being navigated. See RouteLineColorResources to specify the color used.

displaySoftGradientForTraffic

enabling this will display the traffic color transitions with a gradual gradient color blend. If false the color transitions will abruptly transition from one color to the next.

softGradientTransition

this value influences the length of the color transition when the displaySoftGradientForTraffic param is set to true

Constructors

Builder
Link copied to clipboard
fun Builder(context: Context)
Responsible for instantiating an instance of MapboxRouteLineOptions

Functions

build
Link copied to clipboard
fun build(): MapboxRouteLineOptions
displayRestrictedRoadSections
Link copied to clipboard
fun displayRestrictedRoadSections(displayRestrictedRoadSections: Boolean): MapboxRouteLineOptions.Builder
Indicates if the route line will display restricted road sections with a dashed line.
displaySoftGradientForTraffic
Link copied to clipboard
Influences the appearance of the gradient used for the traffic line.
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open fun hashCode(): Int
softGradientTransition
Link copied to clipboard
fun softGradientTransition(transitionDistance: Int): MapboxRouteLineOptions.Builder
When displayRestrictedRoadSections is set to true this value will influence the length of the gradient transition between traffic congestion colors.
styleInactiveRouteLegsIndependently
Link copied to clipboard
Enabling this feature will result in route legs that aren't currently being navigated to be color differently than the active leg.
toString
Link copied to clipboard
open fun toString(): String
withRouteLineBelowLayerId
Link copied to clipboard
fun withRouteLineBelowLayerId(layerId: String): MapboxRouteLineOptions.Builder
Indicates the elevation of the route line related layers.
withRouteLineResources
Link copied to clipboard
fun withRouteLineResources(resourceProvider: RouteLineResources): MapboxRouteLineOptions.Builder
An instance of RouteLineResources
withRouteStyleDescriptors
Link copied to clipboard
fun withRouteStyleDescriptors(routeStyleDescriptors: List<RouteStyleDescriptor>): MapboxRouteLineOptions.Builder
RouteStyleDescriptor is an override of an alternative route line coloring based on a provided identifier.
withTolerance
Link copied to clipboard
fun withTolerance(tolerance: Double): MapboxRouteLineOptions.Builder
Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance) for the GeoJsonSources created to display the route line.
withVanishingRouteLineEnabled
Link copied to clipboard
fun withVanishingRouteLineEnabled(isEnabled: Boolean): MapboxRouteLineOptions.Builder
Determines if the vanishing route line feature is enabled.