Getting started with Update¶
This tutorial demonstrates how to update a map using the Heidelberg Mobil Map Update Server. Updating your map will not require more than two simple steps:
Check for updates: is a new version of the currently loaded map available on the update server?
Update the map: If a new version is available, download & install it.
Precondition: Please note that in order to update a map, you’ll need to have one installed. The “[1] Getting started with Map v3” tutorial gives more information on how to do this.
Check for map updates¶
Use the checkForMapUpdate static method from class MapSDKUtil
Java
// MapFragment.java
MapSDKUtil.checkForMapUpdate(context, new MapSDK.MapUpdateDelegate() {
@Override
public void onResult(boolean isUpdateAvailable, DeepMap deepMap) {
Log.d("TAG", "checkForMapUpdate onResult: " + isUpdateAvailable);
Log.d("TAG", " new : " + deepMap);
Log.d("TAG", " current: " + MapSDKUtil.getLatestDeepMap(context));
}
});
Update the map¶
Java
// MapFragment.java
MapSDKUtil.installMapUpdate(context, map, new MapSDK.MapInstallDelegate() {
@Override
public void onStart(DeepMap map) {
Log.d(TAG, "MapInstallDelegate: onStart " + map + "size:" + map.size);
}
@Override
public void onFinish(DeepMap map) {
MapSDKUtil.setLatestDeepMap(context, map);
Log.d(TAG, "MapInstallDelegate: onFinish.");
}
@Override
public void onFailed(String error) {
Log.e(TAG, "onFailed: " + error);
}
});
Done! Your current map has been updated.
Note
Our Deep Map™ will try to check & download map data from http://update.deepmap.de/ based on the currently loaded map package (DeepMap.zip).
The installMapUpdate() method downloads and installs the latest map data even if it has already been installed. To avoid unnecessary traffic, please check for map updates first (using the checkForMapUpdate() method).