ExportVectorTilesJob

A job to download a vector tile cache (.vtpk) with its default style or with its associated custom style resources. Alternatively, the job can download only the custom style resources. To make an ExportVectorTilesJob, you must create an ExportVectorTilesTask, as follows:

  • Instantiate the ExportVectorTilesTask with a URL to an ArcGIS vector tile service, if you want to download the vector tile package and its default style resources.

  • Instantiate the ExportVectorTilesTask with a portal item that represents an ArcGIS vector tiled layer, if you want to download the vector tile package and its custom style resources or if you only want to download custom style resources.

After loading the ExportVectorTilesTask, call ExportVectorTilesTask.createDefaultExportVectorTilesParameters to obtain its default ExportVectorTilesParameters. Specify the area of interest and the maximum scale. Be aware that there will no tiles when the map is zoomed in beyond this maximum scale. If you set the maximum scale to 0, the export will include all levels of detail in the service. You can also examine the ExportVectorTilesTask.hasStyleResources to determine if the vector tile service has any custom style resources that override the default style.

Next, you can create the ExportVectorTilesJob, as follows:

To export the vector tiles and/or custom styles, start the ExportVectorTilesJob, monitor progress, and examine the ExportVectorTilesJob.result when the job completes successfully.

Use the ExportVectorTilesResult.vectorTileCache in the ArcGISVectorTiledLayer.ArcGISVectorTiledLayer to create an ArcGIS vector tiled layer. If you downloaded a custom style, use the ExportVectorTilesResult.itemResourceCache in the ArcGISVectorTiledLayer.ArcGISVectorTiledLayer.

Since

200.1.0

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The path that the downloaded vector tile style is saved to. If this job was created with ExportVectorTilesTask.createExportVectorTilesJob, this will be an empty string.

Link copied to clipboard

The parameters used to create this job.

Link copied to clipboard

The path that the downloaded vector tile cache is saved to. The path will have the file extension .vtpk. If this job was created with ExportVectorTilesTask.createExportStyleResourceCacheJob, this will be an empty string.

Inherited properties

Link copied to clipboard
open override val messages: SharedFlow<JobMessage>

The job's messages. Indicates that a new JobMessage was generated.

Link copied to clipboard
open override val progress: StateFlow<Int>

The current progress of the job as a percentage complete. This emits updates when the progress value changes.

Link copied to clipboard
open override val serverJobId: String

The server job Id of the job.

Link copied to clipboard
open override val status: StateFlow<JobStatus>

The status of the job.

Inherited functions

Link copied to clipboard
open suspend override fun cancel(): Result<Boolean>

Cancels this Job and waits for any asynchronous, server-side operations to be canceled. The job is canceled and will result in a JobStatus.Failed status after all cancellation tasks have completed. For jobs running on a server, a cancel request is sent for the associated Job.serverJobId. You should always cancel unneeded jobs (for example when exiting your app) to avoid placing unnecessary load on the server. Examples of server-side jobs include:

Link copied to clipboard
open suspend override fun checkStatus(): Result<Boolean>

Initiates a request to check the server status. If the job is polling the server for status and is in a time gap, then calling this method will ensure a request is sent right away. The result can be false if the job is not checking server status for example if the job status is paused or uploading.

Link copied to clipboard
open override fun pause(): Boolean

Pauses the job.

Link copied to clipboard
open suspend override fun result(): Result<ExportVectorTilesResult>

Suspends until this job has completed. Calling this function does not start the job. In order to start the job call start

Link copied to clipboard
open override fun start(): Boolean

Starts executing the job if the job is not started or paused.

Link copied to clipboard
open override fun toJson(): String

Convert an object to JSON string.