ExportVectorTilesTask

A task used to export vector tiles and optionally a portal item's vector tile style resources. Vector tiles are exported as a vector tile package (.vtpk) file, see com.arcgismaps.mapping.layers.vectortiles.VectorTileCache.

A portal item can contain a custom style resources overriding the vector tile services default style and this can be checked with ExportVectorTilesTask.hasStyleResources. The custom style is exported separately as an ItemResourceCache.

The export vector tiles task can be initialized with a URL using ExportVectorTilesTask.ExportVectorTilesTask. The URL can be to:

  • A vector tile server that ends in "VectorTileServer" and is the rest end-point used to export vector tile packages. The vector tile service must be enabled for export or the task will fail to load.

  • A portal item for a vector tile service or a vector tiled layer with a custom style applied.

  • A vector basemap layer created using a com.arcgismaps.mapping.BasemapStyle.

Alternatively a com.arcgismaps.mapping.PortalItem, referencing a vector tile service or a custom style for a vector tiled layer, can be used with ExportVectorTilesTask.ExportVectorTilesTask.

When using Esri provided vector basemaps that do not support exporting tiles (such as the ArcGIS streets basemap - see com.arcgismaps.mapping.BasemapStyle.ArcGISStreets), an alternative service that supports exporting tiles will be used instead.

Since

200.1.0

Constructors

Link copied to clipboard
constructor(portalItem: PortalItem)

Initialize an export vector tiles task with a portal item of type com.arcgismaps.portal.PortalItemType.VectorTileService. If the portal item is not of type com.arcgismaps.portal.PortalItemType.VectorTileService the task will fail to load.

constructor(url: String)

Initialize an export vector tiles task with a URL to a vector tile service. The URL can be for:

Properties

Link copied to clipboard

Indicates if the task's portal item has any associated style resources that override the default style of the vector tile service. This property will be set to true if the export vector tile task has been loaded and the task's portal item has style resources. The portal item's style resources override the default style of the vector tile service and can be exported as ItemResourceCache.

Link copied to clipboard

The task's portal item which must be of type com.arcgismaps.portal.PortalItemType.VectorTileService. This property can only be set when the task is load status com.arcgismaps.LoadStatus.NotLoaded or com.arcgismaps.LoadStatus.FailedToLoad If the portal item is not of type com.arcgismaps.portal.PortalItemType.VectorTileService the task will fail to load. A vector tile service can be referenced by an item in a portal of type com.arcgismaps.portal.PortalItemType.VectorTileService. This item can also contain custom style resources see ExportVectorTilesTask.hasStyleResources which can be exported as ItemResourceCache.

Link copied to clipboard
val url: String?

The URL for exporting vector tiles. This property can be the URL of:

Link copied to clipboard

The task's com.arcgismaps.mapping.layers.vectortiles.VectorTileSourceInfo representing the source metadata for a vector tile service.

Inherited properties

Link copied to clipboard
open override var apiKey: ApiKey?

The API key allows your app to access ArcGIS location services and private portal items. An API key is a unique long-lived access token that is used to authenticate and monitor requests to ArcGIS location services and private portal items. You can create and manage an API key using your portal when you sign in with an ArcGIS Location Platform account or an ArcGIS Online account with administrator access or a custom role that has the Generate API keys privilege. To learn how to create and manage API keys, go to the Create an API Key tutorial. You must ensure that your API key has the correct privileges to access secure resources.

Link copied to clipboard
open override val loadStatus: StateFlow<LoadStatus>

The load status.

Functions

Link copied to clipboard

Creates and returns the default parameters for the export vector tile task. This function is asynchronous because it makes use of the service metadata to populate the ExportVectorTilesParameters object. Calling this function will trigger the ExportVectorTilesTask to be loaded, unless it is already loaded.

Link copied to clipboard

Return a new export vector tiles job that will download a custom style from a portal item as an item resource cache. The job will return the item resource cache without a vector tile cache. This is useful when a number of different styles are applied to the same underlying vector tile service. This avoids exporting multiple copies of the same tiles.

Link copied to clipboard

Returns a new export vector tiles job that can be used to generate and download a vector tile package containing the vector tiles specified by the parameters (ExportVectorTilesParameters).

fun createExportVectorTilesJob(parameters: ExportVectorTilesParameters, vectorTileCachePath: String, itemResourceCachePath: String): ExportVectorTilesJob

Return a new export vector tiles job that can be used to generate and download a vector tile package and return a custom style as an item resource cache.

Inherited functions

Link copied to clipboard
open override fun cancelLoad()

Cancels loading metadata for the Loadable object.

Link copied to clipboard
open suspend override fun load(): Result<Unit>

Loads the metadata for the object.

Link copied to clipboard
open suspend override fun retryLoad(): Result<Unit>

Loads or retries loading metadata for the object.