Automotive Navigation Application

Onboard map management

Request access

Onboard map management

The MapManagementManager provides information about the currently installed map. Use this to retrieve map identifiers and track when maps were last updated.

Observing map information

Subscribe to receive updates about map information:

import android.util.Log
import com.tomtom.automotive.integration.client.api.mapmanagement.MapInfo
import com.tomtom.automotive.integration.client.api.mapmanagement.MapInfoResponse
import com.tomtom.automotive.integration.client.api.mapmanagement.MapManagementManager
import com.tomtom.automotive.integration.client.api.mapmanagement.ObserveMapInfoListener
import com.tomtom.automotive.integration.client.common.Callback
import com.tomtom.automotive.integration.client.common.SdkReleasable
private val TAG = "MapManagement"
private var observeMapInfoReleasable: SdkReleasable? = null
fun observeMapInfo(mapManagementManager: MapManagementManager) {
observeMapInfoReleasable = mapManagementManager.observeMapInfo(
object : ObserveMapInfoListener {
override fun onMapInfo(mapInfoResponse: MapInfoResponse) {
val mapInfo = mapInfoResponse.mapInfo
if (mapInfo != null) {
Log.d(TAG, "Map ID: ${mapInfo.id}")
Log.d(TAG, "Last update: ${mapInfo.lastUpdateDateOfCurrentRegion}")
} else {
Log.w(TAG, "Map information unavailable")
}
}
override fun onFunctionalityUnavailable(reason: Callback.Reason) {
Log.e(TAG, "Map info unavailable: ${reason.devMessage}")
}
}
)
}
fun unObserveMapInfo() {
observeMapInfoReleasable?.release()
observeMapInfoReleasable = null
}

MapInfo structure

The MapInfo object contains:

  • id - The identifier of the map. If multiple maps are installed, this string contains their identifiers separated by / (e.g., 45251/48988/49019)
  • lastUpdateDateOfCurrentRegion - The most recent update timestamp of the current map region (as ZonedDateTime?). Note that this is the time when the update was created, not when the region was installed on the device.