MapboxRouteLineView

class MapboxRouteLineView(options: MapboxRouteLineOptions)

Responsible for rendering side effects produced by the MapboxRouteLineApi. The MapboxRouteLineApi class consumes route data from the Navigation SDK and produces the data necessary to visualize one or more routes on the map. This class renders the data from the MapboxRouteLineApi by calling the appropriate map related commands so that the map can have an appearance that is consistent with the state of the navigation SDK and the application.

Each Layer added to the map by this class is a persistent layer - it will survive style changes. This means that if the data has not changed, it does not have to be manually redrawn after a style change. See Style.addPersistentStyleLayer.

Many of the method calls execute tasks on a background thread. A cancel method is provided in this class which will cancel the background tasks.

Parameters

options

resource options used rendering the route line on the map

Constructors

MapboxRouteLineView
Link copied to clipboard
fun MapboxRouteLineView(options: MapboxRouteLineOptions)
resource options used rendering the route line on the map

Functions

cancel
Link copied to clipboard
fun cancel()
Cancels any/all background tasks that may be running.
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
getAlternativeRoutesVisibility
Link copied to clipboard
fun getAlternativeRoutesVisibility(style: Style): Visibility?
Returns the visibility of the alternative route(s) map layer.
getPrimaryRouteVisibility
Link copied to clipboard
fun getPrimaryRouteVisibility(style: Style): Visibility?
Returns the visibility of the primary route map layer.
hashCode
Link copied to clipboard
open fun hashCode(): Int
hideAlternativeRoutes
Link copied to clipboard
fun hideAlternativeRoutes(style: Style)
Hides the layers used for the alternative route line(s).
hideOriginAndDestinationPoints
Link copied to clipboard
fun hideOriginAndDestinationPoints(style: Style)
Sets the layer containing the origin and destination icons to not visible.
hidePrimaryRoute
Link copied to clipboard
fun hidePrimaryRoute(style: Style)
Hides the layers used for the primary route line.
initializeLayers
Link copied to clipboard
fun initializeLayers(style: Style)
Will initialize the route line related layers.
renderClearRouteLineValue
Link copied to clipboard
fun renderClearRouteLineValue(style: Style, clearRouteLineValue: Expected<RouteLineError, RouteLineClearValue>)
Applies side effects related to clearing the route(s) from the map.
renderRouteDrawData
Link copied to clipboard
fun renderRouteDrawData(style: Style, routeDrawData: Expected<RouteLineError, RouteSetValue>)
Applies drawing related side effects.
renderRouteLineUpdate
Link copied to clipboard
fun renderRouteLineUpdate(style: Style, update: Expected<RouteLineError, RouteLineUpdateValue>)
Applies side effects related to the vanishing route line feature.
showAlternativeRoutes
Link copied to clipboard
fun showAlternativeRoutes(style: Style)
Shows the layers used for the alternative route line(s).
showOriginAndDestinationPoints
Link copied to clipboard
fun showOriginAndDestinationPoints(style: Style)
Sets the layer containing the origin and destination icons to visible.
showPrimaryRoute
Link copied to clipboard
fun showPrimaryRoute(style: Style)
Shows the layers used for the primary route line.
toString
Link copied to clipboard
open fun toString(): String

Properties

options
Link copied to clipboard
var options: MapboxRouteLineOptions
resource options used rendering the route line on the map