TPEGTrafficService
public class TPEGTrafficService : TrafficService
extension TPEGTrafficService: OnStoreAccessChangedObserver
extension TPEGTrafficService: LocationProviderObservable
Reacts on and controls TPEG traffic provider behavior.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public convenience init( store: NDSStore, configuration: TPEGTrafficClientConfiguration, locationEngine: LocationProvider ) throws
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var isConnected: Bool { get }
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var trafficEventCount: Int { get }
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var trafficInterface: UnsafeMutableRawPointer? { get }
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func updateCurrentPosition(_ position: CLLocationCoordinate2D)
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func updateRoutesForTraffic(_ routes: [[CLLocationCoordinate2D]])
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func updateLocale(_ locale: Locale)
-
trafficEvents(for:
Asynchronous) Returns
TrafficEvents
within the givenboundingBox
.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func trafficEvents( for boundingBox: TomTomSDKCommon.BoundingBox ) async throws -> [TomTomSDKCommon.TrafficEvent]
Parameters
boundingBox
The area to look for the
TrafficEvents
. -
Asynchronously calls a completion callback with a result containing
TrafficEvents
within the givenboundingBox
, or an error.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func getTrafficEvents( for boundingBox: TomTomSDKCommon.BoundingBox, completion: @escaping (Result<[TomTomSDKCommon.TrafficEvent], Error>) -> () )
Parameters
boundingBox
The area to look for the
TrafficEvents
.completion
The completion handler to call with the result. The handler is executed on a background thread.
-
Important
This is a Public Preview API. It may be changed or removed at any time.Important
An attempt to add an observer from theonTrafficUpdated()
implementation of a registered observer will result in a deadlock.Declaration
Swift
public func addObserver(_ observer: TrafficUpdateObserver)
-
Important
This is a Public Preview API. It may be changed or removed at any time.Important
An attempt to remove an observer from theonTrafficUpdated()
implementation of a registered observer will result in a deadlock.Declaration
Swift
public func removeObserver(_ observer: TrafficUpdateObserver)
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func notifyMapLoaded()
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func notifyMapUnloading()
-
Important
This is a Public Preview API. It may be changed or removed at any time. Sets a new location engine.Declaration
Swift
public func updateLocationProvider(_ locationProvider: LocationProvider)
Parameters
locationProvider
The new
LocationProvider
.
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var onStoreAccessChangedObserverId: String { get }
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func onReadOnlyAccessGranted(mapChanged: Bool)
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func onReadOnlyAccessReleaseRequested(accessReleased: @escaping () -> ())
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func onAuthorizationStatusChanged(isGranted: Bool)
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func onHeadingUpdate(newHeading _: CLHeading, lastLocation _: GeoLocation)
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func onLocationUpdated(location: GeoLocation)