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 register 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)

Constructors

Link copied to clipboard
constructor(speed: Speed, speedLimit: SpeedLimit? = null, road: RoadProperties? = null, address: Address? = null)

Properties

Link copied to clipboard
val address: Address? = null

The address at the current location, or null if address data is not available.

Link copied to clipboard
val road: RoadProperties? = null

The properties of the road at the current location, or null if the current location is off-road.

Link copied to clipboard

The current speed at the current location.

Link copied to clipboard
val speedLimit: SpeedLimit? = null

The speed limit at the current location, or null if the current location is off-road or speed limit data is not available.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String