LocationContext
public struct LocationContext : Equatable
Location context contains detailed information about the current location during navigating.
To retrieve location context:
- implement the
NavigationLocationContextObserver
protocol - register the observer using the
TomTomNavigation.addLocationContextObserver(_:)
method of the initializedTomTomNavigation
object After navigation has started (with or without a route), you will receiveLocationContext
via theNavigationLocationContextObserver.didDetectLocationContext(locationContext:)
method. “`
class NavigationLocationContextObserverImpl : NavigationLocationContextObserver { override func didDetectLocationContext(locationContext: LocationContext) {} }
private let navigationLocationContextObserver = NavigationLocationContextObserverImpl() … tomTomNavigation.addLocationContextObserver(navigationLocationContextObserver)
-
The current speed of the vehicle at the current location.
Declaration
Swift
public let speed: Measurement<UnitSpeed>
-
The
SpeedLimit
at the current location, or nil if the current location is off-road or speed limit data is not available.Declaration
Swift
public let speedLimit: TomTomSDKCommon.SpeedLimit?
-
The
RoadProperties
at the current location, or nil if the current location is off-road.Declaration
Swift
public let road: RoadProperties?