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

vanishingRouteLineUpdateIntervalNano

can be used to decrease the frequency of the vanishing route line updates improving the performance at the expense of visual appearance of the vanishing point on the line during navigation.

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
vanishingRouteLineUpdateInterval
Link copied to clipboard
fun vanishingRouteLineUpdateInterval(interval: Long = RouteLayerConstants.DEFAULT_VANISHING_POINT_MIN_UPDATE_INTERVAL_NANO): MapboxRouteLineOptions.Builder
Used for throttling the interval of updates to the vanishing route line.
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.