TPEGTrafficService

@available(*, deprecated, message: "This API is deprecated and will be removed with the next major release.\nPlease use TomTomSDKTrafficEngine instead.")
public class TPEGTrafficService : TrafficService

Reacts on and controls TPEG traffic provider behavior.

  • Declaration

    Swift

    public var isConnected: Bool { get }
  • Declaration

    Swift

    public var trafficEventCount: Int { get }
  • Declaration

    Swift

    public var trafficInterface: UnsafeMutableRawPointer? { get }
  • Declaration

    Swift

    public func updateCurrentPosition(_ position: CLLocationCoordinate2D) throws
  • Declaration

    Swift

    public func updateRoutesForTraffic(_ routes: [[CLLocationCoordinate2D]]) throws
  • Declaration

    Swift

    public func updateLocale(_ locale: Locale)
  • trafficEvents(for:) Asynchronous

    Gets trafficEvents.

    Throws

    An error if cannot get TrafficEvents.

    Declaration

    Swift

    @available(*, deprecated, message: "This API is deprecated and will be removed with the next major release.\nPlease use TomTomSDKTrafficEngine.TrafficFactory to create an instance of TrafficService and use TrafficService.trafficEvents(_:﹚ instead.")
    public func trafficEvents(
        for boundingBox: TomTomSDKCommon.BoundingBox
    ) async throws -> [TomTomSDKCommon.TrafficEvent]

    Parameters

    boundingBox

    The area to look for the TrafficEvents.

    Return Value

    Array of TrafficEvents within the given boundingBox.

  • Asynchronously calls a completion callback with a result containing TrafficEvents within the given boundingBox, or an error.

    Declaration

    Swift

    @available(*, deprecated, message: "This API is deprecated and will be removed with the next major release.\nPlease use TomTomSDKTrafficEngine.TrafficFactory to create an instance of TrafficService\nand use TrafficService.getTrafficEvents(_:,_:﹚ instead.")
    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.

  • Adds observer.

    Important

    An attempt to add an observer from the onTrafficUpdated() implementation of a registered observer will result in a deadlock.

    Declaration

    Swift

    @available(*, deprecated, message: "This API is deprecated and will be removed with the next major release.\nPlease use TomTomSDKTrafficEngine.TrafficFactory to create an instance of TrafficService and use TrafficService.addObserver(_:﹚ instead.")
    public func addObserver(_ observer: TrafficUpdateObserver)

    Parameters

    observer

    An instance of TrafficUpdateObserver to add.

  • Removes observer.

    Important

    An attempt to remove an observer from the onTrafficUpdated() implementation of a registered observer will result in a deadlock.

    Declaration

    Swift

    @available(*, deprecated, message: "This API is deprecated and will be removed with the next major release.\nPlease use TomTomSDKTrafficEngine.TrafficFactory to create an instance of TrafficService and use TrafficService.removeObserver(_:﹚ instead.")
    public func removeObserver(_ observer: TrafficUpdateObserver)

    Parameters

    observer

    An instance of TrafficUpdateObserver to remove.

  • Declaration

    Swift

    @available(*, deprecated, message: "This API is deprecated and will be removed with the next major release.\nPlease use TomTomSDKTrafficEngine.TrafficFactory to create an instance of TrafficService\nand use TrafficService.updateLocationProvider(_:﹚ instead.")
    public func updateLocationProvider(_ locationProvider: LocationProvider)

    Parameters

    locationProvider

    The new LocationProvider.