Skip To Content ArcGIS for Developers Sign In Dashboard

ExportVectorTilesTask Class

(Esri::ArcGISRuntime::ExportVectorTilesTask)

A task used to export vector tiles and their style resource cache. More...

Header: #include <ExportVectorTilesTask>
Since: Esri::ArcGISRuntime 100.2
Inherits: Object, Loadable, and RemoteResource

Public Functions

ExportVectorTilesTask(const QUrl &url, QObject *parent = nullptr)
ExportVectorTilesTask(const QUrl &url, Credential *credential, QObject *parent = nullptr)
ExportVectorTilesTask(PortalItem *portalItem, QObject *parent = nullptr)
~ExportVectorTilesTask()
TaskWatcher createDefaultExportVectorTilesParameters(const Geometry &areaOfInterest, double maxScale)
ExportVectorTilesJob *exportStyleResourceCache(const QString &itemResourcePath)
ExportVectorTilesJob *exportVectorTiles(const ExportVectorTilesParameters &parameters, const QString &vectorTileCachePath)
ExportVectorTilesJob *exportVectorTiles(const ExportVectorTilesParameters &parameters, const QString &vectorTileCachePath, const QString &itemResourcePath)
bool hasStyleResources() const
PortalItem *portalItem() const
VectorTileSourceInfo sourceInfo() const

Reimplemented Public Functions

virtual void cancelLoad()
virtual Credential *credential() const
virtual void load()
virtual Error loadError() const
virtual LoadStatus loadStatus() const
virtual RequestConfiguration requestConfiguration() const
virtual void retryLoad()
virtual void setRequestConfiguration(const RequestConfiguration &requestConfiguration)
virtual QUrl url() const

Signals

void createDefaultExportVectorTilesParametersCompleted(QUuid taskId, const Esri::ArcGISRuntime::ExportVectorTilesParameters &defaultExportVectorTilesParameters)
void doneLoading(Esri::ArcGISRuntime::Error loadError)
void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 10 static public members inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

A task used to export vector tiles and their style resource cache.

Use this in conjunction with a vector tile service or PortalItem to generate and download vector tile packages.

Vector tiles are exported as a vector tile package (.vtpk) file. A portal item may contain custom style resources overriding the vector tile service's default style and this can be checked with hasStyleResources. The custom style is exported separately as a ItemResourceCache. The export vector tiles task can be instantiated with a service URL to the vector tile service or with portal item referencing a vector tile service. The vector tile service must be enabled for export or the task will fail to load.

A vector tile service URL ends with VectorTileServer. Alternatively, if the URL refers to an item in a portal, then create an instance of a PortalItem and use it to instantiate the ExportVectorTilesTask.

Member Function Documentation

ExportVectorTilesTask::ExportVectorTilesTask(const QUrl &url, QObject *parent = nullptr)

Constructs an ExportVectorTilesTask with a url to a vector tile service and an optional parent.

The vector tile service must be enabled for export or the task will fail to load. A vector tile service URL ends with VectorTileServer.

ExportVectorTilesTask::ExportVectorTilesTask(const QUrl &url, Credential *credential, QObject *parent = nullptr)

Constructs an ExportVectorTilesTask with a url to a vector tile service, a credential for the secured service, and an optional parent.

The vector tile service must be enabled for export or the task will fail to load. A vector tile service URL ends with VectorTileServer.

ExportVectorTilesTask::ExportVectorTilesTask(PortalItem *portalItem, QObject *parent = nullptr)

Constructs an ExportVectorTilesTask with a portalItem that is a vector tiled layer, and an optional parent.

If the portal item is not of type PortalItemType::VectorTileService then the task will fail to load.

ExportVectorTilesTask::~ExportVectorTilesTask()

Destructor.

[virtual] void ExportVectorTilesTask::cancelLoad()

Reimplemented from Loadable::cancelLoad().

See Loadable.

TaskWatcher ExportVectorTilesTask::createDefaultExportVectorTilesParameters(const Geometry &areaOfInterest, double maxScale)

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

It will calculate the levels of detail (LODs) required based on the specified maxScale. Set to 0 to include all levels of detail.

The areaOfInterest represent the geographic area for which vector 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.

[signal] void ExportVectorTilesTask::createDefaultExportVectorTilesParametersCompleted(QUuid taskId, const Esri::ArcGISRuntime::ExportVectorTilesParameters &defaultExportVectorTilesParameters)

Signal emitted when createDefaultExportVectorTilesParameters completes.

[virtual] Credential *ExportVectorTilesTask::credential() const

Reimplemented from RemoteResource::credential().

Returns the security credential used to access the tiled ArcGIS map service.

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

[signal] void ExportVectorTilesTask::doneLoading(Esri::ArcGISRuntime::Error loadError)

Signal emitted when this object is done loading.

  • loadError - Details about any error that may have occurred.

If there is a load error, it will also be emitted on the errorOccurred signal.

See also Loadable and Object.

ExportVectorTilesJob *ExportVectorTilesTask::exportStyleResourceCache(const QString &itemResourcePath)

Returns a job which can be used to download only the custom style from a vector tile layer.

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.

The style resource will be downloaded to the location specified in the itemResourcePath.

An ExportVectorTilesJob, representing the progress on the server, is returned. The result of the job will be of type ExportVectorTilesResult, which contains a ItemResourceCache that contains the style.

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

See also Job.

ExportVectorTilesJob *ExportVectorTilesTask::exportVectorTiles(const ExportVectorTilesParameters &parameters, const QString &vectorTileCachePath)

Returns a job which can be used to download a vector tile package from an ArcGIS service or portal item.

The extent and other characteristics of the output vector tile package are determined by the supplied parameters. The vector tile package will be downloaded to the location specified in the vectorTileCachePath.

An ExportVectorTilesJob, representing the progress on the server, is returned. The result of the job will be of type ExportVectorTilesResult, which contains a VectorTileCache that can be used to create an ArcGISVectorTiledLayer.

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

See also Job.

ExportVectorTilesJob *ExportVectorTilesTask::exportVectorTiles(const ExportVectorTilesParameters &parameters, const QString &vectorTileCachePath, const QString &itemResourcePath)

Returns a job which can be used to download a vector tile package with custom style from an ArcGIS service or portal item.

The extent and other characteristics of the output vector tile package are determined by the supplied parameters. The vector tile package and style resource will be downloaded to the location specified in the vectorTileCachePath and itemResourcePath, respectively.

An ExportVectorTilesJob, representing the progress on the server, is returned. The result of the job will be of type ExportVectorTilesResult, which contains a VectorTileCache and ItemResourceCache. These can be used to create an ArcGISVectorTiledLayer with a custom style.

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

See also Job.

bool ExportVectorTilesTask::hasStyleResources() const

Returns whether this task's portal item has any associated style resources that override the default style of the vector tile service.

The portal item's style resources override the default style of the vector tile service and can be exported as an ItemResourceCache.

[virtual] void ExportVectorTilesTask::load()

Reimplemented from Loadable::load().

See Loadable.

[virtual] Error ExportVectorTilesTask::loadError() const

Reimplemented from Loadable::loadError().

See Loadable.

[virtual] LoadStatus ExportVectorTilesTask::loadStatus() const

Reimplemented from Loadable::loadStatus().

See Loadable.

[signal] void ExportVectorTilesTask::loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

Signal emitted when the load status changes for this object.

See also Loadable.

PortalItem *ExportVectorTilesTask::portalItem() const

Returns the task's portal item representing a vector tile service.

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 hasStyleResources) which can be exported as an ItemResourceCache.

This returns nullptr if this task was instantiated with a vector tile service rather than a portal item.

[virtual] RequestConfiguration ExportVectorTilesTask::requestConfiguration() const

Reimplemented from RemoteResource::requestConfiguration().

Returns the RequestConfiguration in use by this task.

See also setRequestConfiguration().

[virtual] void ExportVectorTilesTask::retryLoad()

Reimplemented from Loadable::retryLoad().

See Loadable.

[virtual] void ExportVectorTilesTask::setRequestConfiguration(const RequestConfiguration &requestConfiguration)

Reimplemented from RemoteResource::setRequestConfiguration().

Sets configuration parameters used for network requests sent by this task to requestConfiguration.

See also requestConfiguration().

VectorTileSourceInfo ExportVectorTilesTask::sourceInfo() const

Returns the VectorTileSourceInfo representing the source metadata for a vector tile service.

[virtual] QUrl ExportVectorTilesTask::url() const

Reimplemented from RemoteResource::url().

Returns the URL to a vector tiled service.

A vector tile service URL ends in VectorTileServer and is the REST end-point used to export vector tile packages. The service can also be referenced by a portal item. See portalItem.


Feedback on this topic?