Location context

VERSION 0.32.0
PUBLIC PREVIEW

Navigation SDK for Android is only available upon request. Contact us to get started.

The detailed information about a current location on the road is called the location context.

Every location update that comes from LocationProvider to TomTomNavigation is map-matched.

The map-matched locations are then used as input for LocationContextProviderEngine, which returns a LocationContext object.

LocationContext consists of:

  • speed - This is the current Speed, or null if it is unknown.
  • speedLimit - This is the SpeedLimit, or null if the current location is off-road or speed limit on road is not available.
  • road - This contains properties of the current Road, or null if the current location is off-road.
  • address - This is the current Address, or null if it is not available.

The extracted LocationContext is sent to LocationContextUpdatedListener.

1val locationContextUpdatedListener = object : LocationContextUpdatedListener {
2 override fun onLocationContextUpdated(locationContext: LocationContext) {
3 /* YOUR CODE GOES HERE */
4 }
5}
6tomTomNavigation.addLocationContextUpdatedListener(locationContextUpdatedListener)

To remove a previously-added LocationContextUpdatedListener, use the TomTomNavigation.removeLocationContextUpdatedListener(LocationContextUpdatedListener) method.

tomTomNavigation.removeLocationContextUpdatedListener(locationContextUpdatedListener)

Next steps

Since you have learned about location context, here are recommendations for the next steps: