RoutingVisualization
Entry point for all methods related to the routing visualization.
Instances of RoutingVisualization are created using RoutingVisualizationFactory.create. You should call methods on these instances from the main thread only, otherwise an exception can occur.
A RoutingVisualization instance is used by first providing a RoutePlan with displayRoutePlan. After that, the Routes contained in the RoutePlan are displayed on the map, and you can use setActiveRoute to select a route to be navigated on. You can access the list of route primitives displayed on the map using routes. The active route and the alternative routes are styled with the properties contained in the StyleConfiguration provided to RoutingVisualizationFactory.create. You can then call clearRoutePlan to remove all the primitives that have been added to the map by RoutingVisualization.
Visualization of on-route traffic incidents can be enabled or disabled using setTrafficIncidentsEnabled. If a Route contained in the RoutePlan has traffic data available and areTrafficIncidentsEnabled is true
, traffic incidents are displayed on the map on top of that Route. You can access the list of traffic incidents that are on a route using getTrafficIncidents.
To support Android configuration changes properly, create a RoutingVisualization instance on the ViewModel and use replaceMap once the Activity/Fragment is recreated.
Properties
The active Route.
Tells if visualization of on-route traffic incidents is enabled.
Reports whether automatic zoom to routes is enabled.
Functions
Removes all alternative routes and corresponding traffic incidents added with displayRoutePlan from the map and keeps the activeRoute.
Clears RoutingVisualization.
Displays a RoutePlan on the map.
Gets the list of TrafficIncidents that are being displayed on a certain Route.
Replaces the current TomTomMap with a new one.
Set as active a Route from the routes displayed on the map.
Enables or disables visualization of on-route traffic incidents.
Enables or disables automatic zoom to routes when displayRoutePlan is invoked.
Update the data associated to the RoutingRoute that are being displayed.