MapboxRouteLineViewOptions

class MapboxRouteLineViewOptions

Options for configuration of MapboxRouteLineView.

Parameters

context

context

routeLineColorResources

an instance of RouteLineColorResources containing color information

scaleExpressions

an instance of RouteLineScaleExpressions containing custom scaling expressions

restrictedRoadDashArray

the dash array for the LineLayer used for displaying restricted roads

restrictedRoadOpacity

the opacity of the restricted road LineLayer

restrictedRoadLineWidth

the width of the restricted road LineLayer

displaySoftGradientForTraffic

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

softGradientTransition

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

originWaypointIcon

an icon representing the origin point of a route

destinationWaypointIcon

an icon representing the destination point of a route

waypointLayerIconOffset

the list of offset values for waypoint icons

waypointLayerIconAnchor

the anchor value, the default is IconAnchor.CENTER

iconPitchAlignment

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

displayRestrictedRoadSections

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.

routeLineBelowLayerId

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.

tolerance

the tolerance value used when configuring the underlying map source

shareLineGeometrySources

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.

lineDepthOcclusionFactor

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

slotName

determines the position of the route layers in the map style. The route line will default to the RouteLayerConstants.DEFAULT_ROUTE_LINE_SLOT slot. To change, add your own custom slot before route line initialization and provide the slot name as a option here. see https://docs.mapbox.com/style-spec/reference/slots/ and StyleManager.getStyleSlots

fadeOnHighZoomsConfig

configuration for fading out of the route line. See FadingConfig for details. If not set, the route line will be fully opaque at all zoom levels. NOTE: this property guards fading out the route line on transition from a lower to a higher zoom level, meaning that FadingConfig.startFadingZoom must be less than or equal to FadingConfig.finishFadingZoom.

Types

Link copied to clipboard
class Builder(context: Context)

A builder used to create instance of MapboxRouteLineViewOptions.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this one.

Link copied to clipboard
open override fun hashCode(): Int

Returns a hash code value for the object.

Link copied to clipboard
fun toBuilder(): MapboxRouteLineViewOptions.Builder

Creates a builder matching this instance.

Link copied to clipboard
open override fun toString(): String

Returns a string representation of the object.

Properties

Link copied to clipboard
val destinationWaypointIcon: Drawable
Link copied to clipboard
val displayRestrictedRoadSections: Boolean
Link copied to clipboard
val displaySoftGradientForTraffic: Boolean
Link copied to clipboard
val fadeOnHighZoomsConfig: FadingConfig?
Link copied to clipboard
val iconPitchAlignment: IconPitchAlignment
Link copied to clipboard
val lineDepthOcclusionFactor: Double
Link copied to clipboard
val originWaypointIcon: Drawable
Link copied to clipboard
val restrictedRoadDashArray: List<Double>
Link copied to clipboard
val restrictedRoadLineWidth: Double
Link copied to clipboard
val restrictedRoadOpacity: Double
Link copied to clipboard
val routeLineBelowLayerId: String?
Link copied to clipboard
val routeLineColorResources: RouteLineColorResources
Link copied to clipboard
val scaleExpressions: RouteLineScaleExpressions
Link copied to clipboard
val shareLineGeometrySources: Boolean
Link copied to clipboard
val slotName: String
Link copied to clipboard
val softGradientTransition: Double
Link copied to clipboard
val tolerance: Double
Link copied to clipboard
val waypointLayerIconAnchor: IconAnchor
Link copied to clipboard
val waypointLayerIconOffset: List<Double>