TrafficBroadcast
public class TrafficBroadcast : LocationDelegate
extension TrafficBroadcast: NativeBase
extension TrafficBroadcast: Hashable
A TrafficBroadcast is expecting the RDS-TMC
format and it can be used when there is no internet connection, so that the OfflineRoutingEngine
can utilize traffic data coming over a radio channel. The TrafficBroadcast.activate(...) method needs to be called to
receive traffic data events.
Note: In order to adopt the TrafficDataProvider interface special hardware is required. Talk
to your HERE representative for more details. Only by adopting the TrafficDataProvider interface
you can integrate radio station signals providing traffic broadcasts. Traffic broadcasts are meant
to be used independently from the already included traffic on routes, on the map and from the
HERE backends (when using the TrafficEngine).
This class continuously reacts to new locations provided from a location source and acts as a
LocationDelegate. The location must be updated regardless of calling TrafficBroadcast.activate(...).
Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.
-
Creates a new instance of this class.
Throws
InstantiationErrorwhen the object was not initialized properly.Declaration
Swift
public init(parameters: TrafficBroadcastParameters) throwsParameters
parametersThe necessary parameters to start traffic broadcast.
-
Creates a new instance of this class.
Throws
InstantiationErrorwhen the object was not initialized properly.Declaration
Swift
public init(_ sdkEngine: SDKNativeEngine, parameters: TrafficBroadcastParameters) throwsParameters
sdkEngineInstance of an existing SDKEngine.
parametersThe necessary parameters to start traffic broadcast.
-
The traffic data provider that provides the traffic information.
Declaration
Swift
public var trafficDataProvider: TrafficDataProvider? { get } -
Called each time a new location is available. In a navigation context while using the
NavigatororVisualNavigator, it’s required to set theLocation.timeparameter for eachLocationobject so that the HERE SDK can map-match the locations properly. If theLocation.timeparameter is missing, the location will be ignored. For navigation, it is also recommended to provide thebearingandspeedparameters for eachLocationobject. Invoked on the main thread.Declaration
Swift
public func onLocationUpdated(_ location: Location)Parameters
locationCurrent location.
-
Activates the reception of traffic data over the radio channel. This method is supposed to be called when the system loses internet connection, so that traffic data can be switched from the online source to the radio channel. When activation is done, requestTMCService is called from TMCServiceInterface
Declaration
Swift
public func activate() -
Deactivates the reception of traffic data over the radio channel. When deactivation is done, requestTMCService is called from TMCServiceInterface With special case of countryCode parameter = 0
Declaration
Swift
public func deactivate() -
Must be called on every TMC service prodiver info update.
Declaration
Swift
public func onTMCServiceProviderInfoUpdated(tmcServiceProdiverInfo: TMCServiceProviderInfo)Parameters
tmcServiceProdiverInfoContains service prodiver info in RDS-TMC format.
-
Must be called on every TMC data update.
Declaration
Swift
public func onTMCDataUpdated(tmcData: TMCData)Parameters
tmcDataContains the traffic events in RDS-TMC format.