ExportVectorTilesTask

A task to download vector tiles with their default style or with their associated custom style resources. Optionally, the task can download only the custom style resources. Vector tiles are exported as a vector tile package (.vtpk) file, see VectorTileCache, from a vector tile service. The vector tile service must support the creation of an offline vector tile cache; specifically, it must enable the "exportTiles" operation.

Vector tiles contain vector representations of data that can be restyled for different purposes, such as day and night viewing. You can download default styling resources along with the vector tiles and custom style resources from ArcGIS Portal items that host vector tile layers. You can checked whether the vector tiles have custom styles using ExportVectorTilesTask.hasStyleResources. Custom styles are 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 BasemapStyle.

Alternatively a 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 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)

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

constructor(url: String)

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

Properties

Link copied to clipboard

True if the task's portal item has any associated style resources that override the default style of the vector tile service, false otherwise. 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 PortalItemType.VectorTileService. This property can only be set when the task is load status LoadStatus.NotLoaded or LoadStatus.FailedToLoad If the portal item is not of type PortalItemType.VectorTileService the task will fail to load. A vector tile service can be referenced by an item in a portal of type 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 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 is asynchronous because it makes use of the service metadata to populate the ExportVectorTilesParameters object. 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.