exportTileCache method

ExportTileCacheJob exportTileCache(
  1. {required ExportTileCacheParameters parameters,
  2. required Uri downloadFileUri}
)

Return a new export tile cache job.

The resulting job will export tiles from the service, which is referenced by the ExportTileCacheTask.uri property (or its export-enabled alternative), to a local tile cache at the downloadFilePath. The format of the tile cache is determined by the file extension supplied in the downloadFilePath parameter.

If the download file path ends with ".tpk", the tile cache will use the legacy compact format.

If the download file path ends with ".tpkx", the tile cache will use the current compact version 2 format.

If the service does not support exporting tiles, the job will fail with ArcGISExceptionType.mappingTileExportNotEnabled.

If a .tpkx format was requested, but the format is not supported by the service, the job will fail with ArcGISExceptionType.mappingTileCacheCompactV2ExportNotEnabled.

Parameters:

  • parameters — Export tile cache parameters to be used in exporting.
  • downloadFileUri — Downloaded tile cache file path that ends with .tpk or .tpkx, depending on the desired format.

Return Value: A new ExportTileCacheJob.

Implementation

ExportTileCacheJob exportTileCache(
    {required ExportTileCacheParameters parameters,
    required Uri downloadFileUri}) {
  final coreDownloadFileUri = _CString(downloadFileUri.toFilePath());
  final objectHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_ExportTileCacheTask_exportTileCache(
        _handle, parameters._handle, coreDownloadFileUri.bytes, errorHandler);
  });
  return ExportTileCacheJob._fromHandle(objectHandle)!;
}