downloadPreplannedOfflineMapWithParameters method
- required DownloadPreplannedOfflineMapParameters parameters,
- required Uri downloadDirectoryUri,
Returns a job that is used to download the preplanned map area specified by the given parameters object.
The job that is returned is dormant and needs to be explicitly started. The job will fail if the last directory in the download directory path cannot be created or is not empty.
Parameters:
parameters
— Specifies parameters for the job including the preplanned map area to be downloaded.downloadDirectoryUri
— The path to a folder where the map content is stored on the device. For example, to create a new mobile map package "my_mobile_map_package" in a parent directory "[my root path]/my_mobile_maps", this property would be "[my root path]/my_mobile_maps/my_mobile_map_package".
Return Value: a DownloadPreplannedOfflineMapJob to download a preplanned map area.
Implementation
DownloadPreplannedOfflineMapJob downloadPreplannedOfflineMapWithParameters({
required DownloadPreplannedOfflineMapParameters parameters,
required Uri downloadDirectoryUri,
}) {
final coreDownloadDirectoryUri =
_CString(downloadDirectoryUri.toFilePath());
final objectHandle = _withThrowingErrorHandler((errorHandler) {
return runtimecore
.RT_OfflineMapTask_downloadPreplannedOfflineMapWithParameters(
_handle,
parameters._handle,
coreDownloadDirectoryUri.bytes,
errorHandler,
);
});
return DownloadPreplannedOfflineMapJob._fromHandle(
objectHandle,
)!;
}