downloadArea abstract method

MapDownloaderTask downloadArea(
  1. GeoPolygon area,
  2. DownloadRegionsStatusListener statusListener
)

Performs an asynchronous request to download map data for area specified by a GeoPolygon.

MapDownloader.downloadArea.statusListener is receiving notifications until DownloadRegionsStatusListener.onDownloadRegionsComplete is called. Returned MapDownloaderTask should be used to pause or resume started download, by invoking MapDownloaderTask.pauseWithCompaction or MapDownloaderTask.resume. Request can be cancelled by calling MapDownloaderTask.cancel on returned MapDownloaderTask object, afterwards DownloadRegionsStatusListener.onDownloadRegionsComplete is called with error MapLoaderError.operationCancelled.

MapDownloaderTask remains operational until DownloadRegionsStatusListener.onDownloadRegionsComplete is called.

Downloaded area will be associated to a unique id that will be reported via DownloadRegionsStatusListener.

Simultaneous download of the same region twice is not supported. When such condition occurs then DownloadRegionsStatusListener.onDownloadRegionsComplete is called with error MapLoaderError.serviceAccessFailed for a new request, while previous one continues uninterrupted.

If indexing is enabled through OfflineSearchEngine.setIndexOptions, then after the requested regions have been downloaded, the corresponding index will be created. The index is used by OfflineSearchEngine to find better results. Note: Indexing is a beta feature, so there could be a few bugs and unexpected behaviors.

To control list of map content features for area download, use LayerConfiguration.enabledFeatures.


Note: If an application is forcefully closed or crashes during a map download operation, then this method can be called again to resume the download. For example, if a download was interrupted at 60%, then the next call to download the same region will load the remaining 40%.
Note: If a download fails during runtime, then the HERE SDK will automatically retry to download the affected region three times before giving up. A connection will be timed out after one minute.
Note: If user try to re-download same GeoPolygon the status will be reported as per the state of previous download operation.
  • area Area to download.

  • statusListener Notifies on the download progress.

Returns MapDownloaderTask. Handle that will be used to manipulate the execution of the task, for example, to cancel on ongoing request.

Implementation

MapDownloaderTask downloadArea(GeoPolygon area, DownloadRegionsStatusListener statusListener);