TomTomSDKTraffic
TomTomSDKTraffic
The TomTom Traffic module provides road traffic information, in the form of traffic incidents, for route calculation, visualization, and guidance use cases for both online and offline scenarios. The data availability depends on the provider offering and can be limited to a given radius of the current position, a route, a region, or a country.
-
Interface to the Traffic Data Provider.
Navigation SDK components use the Traffic interface to access traffic information. For example,
TomTomSDKRoutePlannerOffline.OfflineRoutePlanneruses it to calculate routes that avoid traffic.An instance of this interface is created with
TomTomSDKTrafficEngine.TrafficFactory.Once a traffic data provider instance is created and connected to a source of traffic, it will start receiving traffic data as offered by the provider. For example, near the current location, along the route, or for the current country/area. If a route is registered via the
Traffic.updateRoutesForTrafficfunction, the traffic data provider will start receiving traffic information for the given route. When new traffic events are received, the traffic data provider will notify the user via theTrafficUpdateObserverinterface, provided that an observer is registered via theTraffic.addObserverfunction. Users can fetch traffic in an area via theTraffic.trafficEventsandTraffic.getTrafficEventsfunctions.See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol Traffic : AnyObject -
See more
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol TrafficUpdateObserver : AnyObject
TomTom SDK for iOS (0.53.1)
TomTomSDKTraffic