MapboxRouteLineView
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.
If you're recreating the MapboxRouteLineView instance, for example to change the MapboxRouteLineOptions, make sure that your first interaction restores the state and re-applies the options by calling MapboxRouteLineApi.getRouteDrawData and passing the result to MapboxRouteLineView.renderRouteDrawDataInternal.
Parameters
Resource options used rendering the route line on the map
Constructors
Creates MapboxRouteLineView instance.
Functions
Returns the visibility of the alternative route(s) map layer.
Returns the visibility of the primary route map layer.
Returns the visibility of the primary route map traffic layer.
Hides the layers used for the alternative route line(s).
Sets the layer containing the origin and destination icons to not visible.
Hides the layers used for the primary route line.
Hides the layers used for the traffic line(s).
Initializes the route line related layers. Other calls in this class will initialize the layers if they have not yet been initialized. If you have a use case for initializing the layers in advance of any API calls this method may be used.
Applies side effects related to clearing the route(s) from the map.
Applies side effects related to the vanishing route line feature.
Applies drawing related side effects.
Applies side effects related to the vanishing route line feature.
Shows the layers used for the alternative route line(s).
Sets the layer containing the origin and destination icons to visible.
Shows the layers used for the primary route line.
Shows the layers used for the traffic line(s).