LocationContext
class LocationContext(val speed: Speed, val speedLimit: SpeedLimit? = null, val road: RoadProperties? = null, val address: Address? = null)
Location context data, consisting of detailed information about the current location while navigating.
To retrieve location context, you need to start navigation with or without a route and add a com.tomtom.sdk.navigation.LocationContextUpdatedListener when you initialize the required com.tomtom.sdk.navigation.TomTomNavigation object:
private val locationContextUpdatedListener = object : LocationContextUpdatedListener {
override fun onLocationContextUpdated(locationContext: LocationContext) {
// add code here to process location context information
}
}
...
tomTomNavigation.addLocationContextUpdatedListener(locationContextUpdatedListener)
Content copied to clipboard
Constructors
Link copied to clipboard
constructor(speed: Speed, speedLimit: SpeedLimit? = null, road: RoadProperties? = null, address: Address? = null)
Properties
Link copied to clipboard
The properties of the road at the current location, or null if the current location is off-road.
Link copied to clipboard
The speed limit at the current location, or null if the current location is off-road or speed limit data is not available.