Protocols
The following protocols are available globally.
-
The Entry point for all methods related to the routing visualization. Instances of
RoutingVisualization
are created usingRoutingVisualizationFactory.create(map:styleConfiguration:)
. You should call methods on these instances from the main thread only, otherwise an exception can occur. ARoutingVisualization
instance is used by first providing aRoutePlan
withdisplayRoutePlan(_:)
. After that, theTomTomSDKRoute.Route
s contained in theRoutePlan
are displayed on the map, and you can usesetActiveRoute(_:)
to select a route to be navigated on. You can access the list of route primitives displayed on the map usingroutes
. The active route and the alternative routes are styled with the properties contained in theStyleConfiguration
provided toRoutingVisualizationFactory.create(map:styleConfiguration:)
. You can then callclearRoutePlan()
to remove all the primitives that have been added to the map by the module.Visualization of on-route traffic incidents can be enabled or disabled using
See moreareTrafficIncidentsEnabled
. If aTomTomSDKRoute.Route
contained in theRoutePlan
has traffic data available andareTrafficIncidentsEnabled
is true, traffic incidents are displayed on the map on top of thatTomTomSDKRoute.Route
. You can access the list of traffic incidents that are on a route usingtrafficIncidents(on:)
.Declaration
Swift
public protocol RoutingVisualization