Migration Guide - iOS SDK 2.3.x to 3.0.0

With the release of version 3.0.0, our SDK utilizes a new mechanism for storing MapData. For this purpose, the HDMMapStorage class has been introduced. (reference to API)

The main objective of these changes is to differentiate the logic related to storing and rendering. These changes ensure that it’s not necessary to create a HDMMapView (or HDMMapViewController) instance when calling a storage-related API, such as updating or removing MapData. In conjunction with moving the storage-related API out from HDMMapView, we have streamlined the functionality of map updating/downloading. Developers can now determine the status of the map updating process, stop and resume updating from the point in which the process was stopped, and generate queries to find the installed MapData that meets specified parameters.

HDMMapController creating

  • If you load default MapData (DeepMap.zip) into your application (i.e. use constructor without passing DeepMap instance), no changes are needed and everything will work as it did previously:

2.3.x

self.mapViewController = HDMMapViewController()
  • If your application loads map data from a custom location, you have to update it like this:

3.0.0

if let path = Bundle.main.path(forResource: "CustomDeepMap", ofType: "zip"), let deepMap = DeepMap(package: path) {
    self.mapViewController = HDMMapViewController(map: deepMap)
}

Updating

  • If your application uses -checkMapUpdate: and -installMapUpdate: you can continue using them with no necessary changes. While these methods are deprecated, they have not been removed.

  • Refer to the API references here if you would like to use the new updating features (API docs are currently not ready).

Swift

let mapStorage = HDMMapStorage()
let progress = mapStorage.updateMap(currentMap) { (result) in
  if case .success(let newMap) = result {
     mapViewController.map = newMap
  } else {
     print("Can't update map")
   }
}