ArcGIS Developers
Dashboard

ExportTileCacheTask QML Type

A task used to export a tile cache (.tpk or .tpkx). Use this in conjunction with a map/image service to generate and download tile packages. More...

Import Statement: import Esri.ArcGISRuntime 100.10
Since: Esri.ArcGISRuntime 100.0
Inherits:

Object

Properties

Signals

Methods

Detailed Description

This task can be used to download tiles (as a tile package, .tpk file) from supporting tiled ArcGIS map or image services. To check if the service supports this, check the list of supported operations on the service's REST endpoint for "EstimateExportTilesSize" and "ExportTiles". If these are not present, they need to be enabled from the server side before you can export tiles from the service. The service could be hosted in the cloud on ArcGIS Online or on-premises with ArcGIS Server.

To confirm whether a map or image service supports exporting tiles, check:

See TileCache for information on creating a layer from a local tile cache.

When using Esri provided image basemaps (such as the World Imagery basemap, Enums.BasemapStyleArcGISStreets an alternative service that supports exporting tiles may be used instead. For example, the World Imagery Service https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer will be exported using a corresponding export-enabled service (https://tiledbasemaps.arcgis.com/arcgis/rest/services/World_Imagery/MapServer).

Note that these export-enabled services are not intended for use as an online basemap and should only be used for exporting tiles for offline use. The export-enabled services require authentication to export tiles.

This QML type supports the following default properties. A default property may be declared inside another declared object without being assigned explicitly to a property.

TypeDefault Property
Credentialcredential
RequestConfigurationrequestConfiguration (since Esri.ArcGISRuntime 100.1)

See also ApiKeyResource, Loadable, Cancelable, and RemoteResource.

Property Documentation

apiKey : string

Returns the API key.

This property was introduced in Esri.ArcGISRuntime 100.10.

See also ApiKeyResource.


createDefaultExportTileCacheParametersStatus : Enums.TaskStatus

Returns the status of the createDefaultExportTileCacheParameters task.

See also Enums.TaskStatus.


[default] credential : Credential

The Credential for authenticating against a secured service.

This is only applicable if using a service that is secured.


defaultExportTileCacheParameters : ExportTileCacheParameters

Returns the parameters created from createDefaultExportTileCacheParameters() (read-only).

Obtain this property after the createDefaultExportTileCacheParametersStatusChanged signal emits, and the createDefaultExportTileCacheParametersStatus is Enums.TaskStatusCompleted.


error : Error

Returns the error object (read-only).

See also Loadable and Error.


estimateTileCacheSizeJobs : list<EstimateTileCacheSizeJob>

The list of EstimateTileCacheSizeJob objects. Each job can be tracked using the EstimateTileCacheSizeJob::JobStatus property.

See also EstimateTileCacheSizeJob.


exportTileCacheJobs : list<ExportTileCacheJob>

The list of ExportTileCacheJob objects. Each job can be tracked using the ExportTileCacheJob::JobStatus property.

See also ExportTileCacheJob.


loadError : Error

Returns the load error (read-only).

Note: load errors are also reported on the error property and emit the errorChanged signal.

See also Loadable.


loadStatus : Enums.LoadStatus

Returns the load status code of this Loadable object (read-only).

See also Enums.LoadStatus and Loadable.


mapServiceInfo : ArcGISMapServiceInfo

The metadata about the tiled ArcGIS Map service that the task is using. This property is populated after the task loads.


[default] requestConfiguration : RequestConfiguration

The configuration parameters used for network requests sent by this task.

This property was introduced in Esri.ArcGISRuntime 100.1.


url : url

The URL to a tiled ArcGIS Map service.

In the case of Esri provided image basemaps, the meta-data will be for the export-enabled version of the service.


Signal Documentation

createDefaultExportTileCacheParametersStatusChanged()

Emitted when the createDefaultExportTileCacheParametersStatus property changes.

Note: The corresponding handler is onCreateDefaultExportTileCacheParametersStatusChanged.


credentialChanged()

Emitted when the credential property changes.

Note: The corresponding handler is onCredentialChanged.


estimateTileCacheSizeJobsChanged()

Emitted when the estimateTileCacheSizeJobs property of this ExportTileCacheTask changes.

Note: The corresponding handler is onEstimateTileCacheSizeJobsChanged.


exportTileCacheJobsChanged()

Emitted when the exportTileCacheJobs property of this ExportTileCacheTask changes.

Note: The corresponding handler is onExportTileCacheJobsChanged.


loadErrorChanged()

Emitted when the loadError property of this ExportTileCacheTask changes.

Note: load errors are also reported on the error property and emit the errorChanged signal.

Note: The corresponding handler is onLoadErrorChanged.

See also Loadable and Object.


loadStatusChanged()

Emitted when the loadStatus property changes.

Note: The corresponding handler is onLoadStatusChanged.

See also Loadable.


mapServiceInfoChanged()

Emitted when the mapServiceInfo property of this ExportTileCacheTask changes.

Note: The corresponding handler is onMapServiceInfoChanged.


requestConfigurationChanged()

Emitted when the requestConfiguration property changes.

Note: The corresponding handler is onRequestConfigurationChanged.

This signal was introduced in Esri.ArcGISRuntime 100.1.


urlChanged()

Emitted when the url property of this ExportTileCacheTask changes.

Note: The corresponding handler is onUrlChanged.


Method Documentation

bool cancelTask(string taskId)

Cancel the task with the ID taskId.

Returns false if the task cannot be cancelled or there is no task with the specified id taskId.

See also Cancelable.


ExportTileCacheParameters createDefaultExportTileCacheParameters(Geometry areaOfInterest, double minScale, double maxScale)

A convenience method to get properly initialized parameters for exporting tiles.

It will calculate the levels of detail (LODs) required based on the specified minScale and maxScale and the tiling scheme of the service. The areaOfInterest represents the geographic area for which tiles are needed.

The supported geometry types for the area of interest are Envelope and Polygon. The area of interest must have a spatial reference. Where a Polygon is supplied, tiles will be filtered according to the polygon geometry, which can help reduce the size of the resulting tile package. Note that the filtered set of tiles may vary, depending on the underlying service.


EstimateTileCacheSizeJob estimateTileCacheSize(ExportTileCacheParameters parameters)

Returns a job that can be used to get a size estimate of the tile package contaning tiles specified by the parameters.

An EstimateTileCacheSizeJob, representing the progress on the server, is returned. The result of the job will be of type ExportTileCacheSizeEstimate, which will describe the estimated size and number of tiles.

Note: The job is initially in the Enums.JobStatusNotStarted state. It can be started by calling Job::start(). The job should be deleted after completion.

See also Job.


ExportTileCacheJob exportTileCache(ExportTileCacheParameters parameters, url downloadFileUrl)

Returns a job that can be used to download a tile package from an ArcGIS map or image service.

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

The extent, image compression, and other characteristics of the output tile package are determined by the supplied parameters. The tile package will be downloaded to the location specified in the downloadFileUrl.

The resulting job will export tiles from the service, which is referenced by the url 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 an error code of 7007.

If a .tpkx format was requested, but the format is not supported by the service, the job will fail with an error code of 7024.

An ExportTileCacheJob, representing the progress on the server, is returned. The result of the job will be of type TileCache, which can be used to create an ArcGISTiledLayer.

Note: The job is initially in the Enums.JobStatusNotStarted state. It can be started by calling Job::start(). The job should be deleted after completion.

See also Job.



Feedback on this topic?