generateOfflineMap method
- {required GenerateOfflineMapParameters parameters,
- required Uri downloadDirectoryUri,
- GenerateOfflineMapParameterOverrides? overrides}
Returns a job that is used to generate an offline map using the specified parameters and overrides.
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.
The GenerateOfflineMapParameterOverrides allows more control over the extracted data.
To create an instance GenerateOfflineMapParameterOverrides use OfflineMapTask.createGenerateOfflineMapParameterOverrides.
Some properties on GenerateOfflineMapParameters will be ignored when using GenerateOfflineMapParameterOverrides and replaced with equivalent properties for each service. The overridden properties are:
- GenerateOfflineMapParameters.includeBasemap
- GenerateOfflineMapParameters.returnLayerAttachmentOption
- GenerateOfflineMapParameters.attachmentSyncDirection
- GenerateOfflineMapParameters.returnSchemaOnlyForEditableLayers
- GenerateOfflineMapParameters.isDefinitionExpressionFilterEnabled
- GenerateOfflineMapParameters.onlineOnlyServicesOption
Parameters:
parameters
— GenerateOfflineMapParameters specify how to take a map offline. For example, specify the area of interest, min and max scale, layer attachment options.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".overrides
— the overrides to the parameters.
Return Value: a GenerateOfflineMapJob to generate an offline map
Implementation
GenerateOfflineMapJob generateOfflineMap(
{required GenerateOfflineMapParameters parameters,
required Uri downloadDirectoryUri,
GenerateOfflineMapParameterOverrides? overrides}) {
final coreDownloadDirectoryUri =
_CString(downloadDirectoryUri.toFilePath());
final objectHandle = _withThrowingErrorHandler((errorHandler) {
return runtimecore.RT_OfflineMapTask_generateOfflineMapCombined(
_handle,
parameters._handle,
coreDownloadDirectoryUri.bytes,
overrides?._handle ?? ffi.nullptr,
errorHandler);
});
return GenerateOfflineMapJob._fromHandle(objectHandle)!;
}