TPEGTrafficClientConfiguration
public struct TPEGTrafficClientConfiguration
Configuration object for the TPEG traffic client.
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. API key used to create a traffic session.Declaration
Swift
public let apiKey: String
Important
This is a Public Preview API. It may be changed or removed at any time. The path to the directory containing files for file feed communication. If set, the onboard traffic subsystem will not communicate with an external server and instead generates responses from files matching the given pattern based on alphanumerical order. Sub-directories are not included. This setting is optional.Declaration
Swift
public let fileFeedPath: String?
Important
This is a Public Preview API. It may be changed or removed at any time. The pattern of files to be used by file feed communication. Only files for which the name matches the given regular expression are considered. This setting is optional.Declaration
Swift
public let fileFeedPattern: String?
init(apiKey:initSessionURL:updateFrequency:innerRadius:outerRadius:maxNumberOfEvents:trafficCacheEnabled:fileFeedPath:fileFeedPattern:webRequestDumpPath:)
Creates a new TPEGTrafficClientConfiguration
object.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public init(
apiKey: String,
// Force unwrap is ok since this is a valid url used for traffic.
initSessionURL: URL = URL(string: "https://preprod.api-system.tomtom.com/tpeg/InitSession")!,
updateFrequency: Measurement<UnitDuration> = .tt.seconds(60),
innerRadius: Measurement<UnitLength> = .tt.kilometers(10),
outerRadius: Measurement<UnitLength> = .tt.kilometers(150),
maxNumberOfEvents: Int = 1000,
trafficCacheEnabled: Bool = false,
fileFeedPath: String? = nil,
fileFeedPattern: String? = nil,
webRequestDumpPath: String? = nil
)
Parameters
apiKey
|
API key used to create a traffic session. |
initSessionURL
|
The resource/page on the server requested in the InitSession request. |
updateFrequency
|
Time to wait before sending the next GetMessage request (defaults to 60s). |
innerRadius
|
Inner Radius (defaults to 10km). |
outerRadius
|
Outer Radius (defaults to 150km). |
maxNumberOfEvents
|
Maximum number of messages the client can handle at a time (defaults to 1000). |
trafficCacheEnabled
|
Enable or disable the traffic cache feature. |
fileFeedPath
|
The path to the directory containing files for file feed communication. |
fileFeedPattern
|
The pattern of files to be used by file feed communication. |
webRequestDumpPath
|
The path to the directory in which dumps will be stored. |
Important
This is a Public Preview API. It may be changed or removed at any time. The resource/page on the server requested in the InitSession request.Declaration
Swift
public let initSessionURL: URL
Important
This is a Public Preview API. It may be changed or removed at any time. Inner Radius (defaults to 10km).Declaration
Swift
public let innerRadius: Measurement<UnitLength>
Important
This is a Public Preview API. It may be changed or removed at any time. Maximum number of messages the client can handle at a time (defaults to 1000).Declaration
Swift
public let maxNumberOfEvents: Int
Important
This is a Public Preview API. It may be changed or removed at any time. Outer Radius (defaults to 150km).Declaration
Swift
public let outerRadius: Measurement<UnitLength>
Important
This is a Public Preview API. It may be changed or removed at any time. Enable or disable the traffic cache feature. If enabled, onboard traffic information will be persisted between sessions, providing faster access to road closure information after starting the app. Defaults to false (disabled).Declaration
Swift
public let trafficCacheEnabled: Bool
Important
This is a Public Preview API. It may be changed or removed at any time. Time to wait before sending the next GetMessage request (defaults to 60s).Declaration
Swift
public let updateFrequency: Measurement<UnitDuration>
Important
This is a Public Preview API. It may be changed or removed at any time. The path to the directory in which dumps will be stored. If this setting is not provided, dumping is disabled.Declaration
Swift
public let webRequestDumpPath: String?