ExportVectorTilesTask Class

  • ExportVectorTilesTask
  • class Esri::ArcGISRuntime::ExportVectorTilesTask

    A task used to export vector tiles and optionally a portal item's vector tile style resources. More...

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

    Public Functions

    ExportVectorTilesTask(const QUrl &url, QObject *parent = nullptr)
    ExportVectorTilesTask(const QUrl &url, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)
    ExportVectorTilesTask(Esri::ArcGISRuntime::PortalItem *portalItem, QObject *parent = nullptr)
    virtual ~ExportVectorTilesTask() override
    QFuture<Esri::ArcGISRuntime::ExportVectorTilesParameters> createDefaultExportVectorTilesParametersAsync(const Esri::ArcGISRuntime::Geometry &areaOfInterest, double maxScale)
    Esri::ArcGISRuntime::ExportVectorTilesJob *exportStyleResourceCache(const QString &itemResourcePath)
    Esri::ArcGISRuntime::ExportVectorTilesJob *exportVectorTiles(const Esri::ArcGISRuntime::ExportVectorTilesParameters &parameters, const QString &vectorTileCachePath)
    Esri::ArcGISRuntime::ExportVectorTilesJob *exportVectorTiles(const Esri::ArcGISRuntime::ExportVectorTilesParameters &parameters, const QString &vectorTileCachePath, const QString &itemResourcePath)
    bool hasStyleResources() const
    Esri::ArcGISRuntime::PortalItem *portalItem() const
    Esri::ArcGISRuntime::VectorTileSourceInfo sourceInfo() const

    Reimplemented Public Functions

    virtual QString apiKey() const override
    virtual void cancelLoad() override
    virtual Esri::ArcGISRuntime::Credential *credential() const override
    virtual void load() override
    virtual Esri::ArcGISRuntime::Error loadError() const override
    virtual Esri::ArcGISRuntime::LoadStatus loadStatus() const override
    virtual Esri::ArcGISRuntime::RequestConfiguration requestConfiguration() const override
    virtual void retryLoad() override
    virtual void setApiKey(const QString &apiKey) override
    virtual void setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration) override
    virtual QUrl url() const override

    Signals

    void doneLoading(const Esri::ArcGISRuntime::Error &loadError)
    void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

    Detailed Description

    Vector tiles are exported as a vector tile package (.vtpk) file, see VectorTileCache.

    A portal item can contain a custom style resources overriding the vector tile services 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 initialized with a URL using ExportVectorTilesTask(QUrl). The URL can be to:

    • A vector tile server that ends in "VectorTileServer" and is the REST endpoint 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(PortalItem).

    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.

    Member Function Documentation

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

    Initialize an export vector tiles task with a URL to a vector tile service.

    • url - The URL of a service or portal item to be used for exporting vector tiles.
    • parent - The optional parent QObject.

    The URL can be for:

    • A vector tile server that ends in "VectorTileServer" and is the REST endpoint used to export vector tile packages. The vector tile service must be enabled for export or the task will fail to load.
    • A PortalItem for a vector tile service or a vector tiled layer with a custom style applied.
    • A vector basemap layer created using a BasemapStyle.

    If the URL represents a PortalItem that can be used to download vector tiles or style resources, the portalItem property will be populated when the task is loaded.

    [explicit] ExportVectorTilesTask::ExportVectorTilesTask(const QUrl &url, Esri::ArcGISRuntime::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.

    [explicit] ExportVectorTilesTask::ExportVectorTilesTask(Esri::ArcGISRuntime::PortalItem *portalItem, QObject *parent = nullptr)

    Initialize an export vector tiles task with a portal item of type PortalItemType::VectorTileService.

    • portalItem - A portal item instance.
    • parent - The optional parent QObject.

    If the portal item is not of type PortalItemType::VectorTileService the task will fail to load. The portal item will reference a vector tile service and once the task is loaded the property url will be populated to the backing service. This portal item can also contain custom style resources. See hasStyleResources which can additionally be exported as ItemResourceCache.

    [override virtual] ExportVectorTilesTask::~ExportVectorTilesTask()

    Destructor.

    [override virtual, since Esri::ArcGISRuntime 100.10] QString ExportVectorTilesTask::apiKey() const

    Reimplements: ApiKeyResource::apiKey() const.

    Returns the API key. See ApiKeyResource.

    This function was introduced in Esri::ArcGISRuntime 100.10.

    See also setApiKey().

    [override virtual] void ExportVectorTilesTask::cancelLoad()

    Reimplements: Loadable::cancelLoad().

    See Loadable.

    [since Esri::ArcGISRuntime 200.2] QFuture<Esri::ArcGISRuntime::ExportVectorTilesParameters> ExportVectorTilesTask::createDefaultExportVectorTilesParametersAsync(const Esri::ArcGISRuntime::Geometry &areaOfInterest, double maxScale)

    Returns the default parameters for the export vector tile task.

    • areaOfInterest - a Geometry specifying the area of vector tiles to be exported. Must not be nullptr.
    • maxScale - the map scale '1:max_scale' which determines how far in to export the vector tiles. Set the value to 0 to include all levels of detail in the service.

    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.

    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.

    A max_scale of 0 will include all levels of detail of the service. Be careful when you provide a large area of interest or a small max_scale value as this could result in a large number of tiles being requested. If the number of tiles requested exceeds the service's maximum export tile count the ExportVectorTilesJob will fail.

    This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.

    See Working with QFuture for further details.

    This function was introduced in Esri::ArcGISRuntime 200.2.

    [override virtual] Esri::ArcGISRuntime::Credential *ExportVectorTilesTask::credential() const

    Reimplements: RemoteResource::credential() const.

    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(const 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.

    Esri::ArcGISRuntime::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.

    Esri::ArcGISRuntime::ExportVectorTilesJob *ExportVectorTilesTask::exportVectorTiles(const Esri::ArcGISRuntime::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.

    Esri::ArcGISRuntime::ExportVectorTilesJob *ExportVectorTilesTask::exportVectorTiles(const Esri::ArcGISRuntime::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.

    [override virtual] void ExportVectorTilesTask::load()

    Reimplements: Loadable::load().

    See Loadable.

    [override virtual] Esri::ArcGISRuntime::Error ExportVectorTilesTask::loadError() const

    Reimplements: Loadable::loadError() const.

    See Loadable.

    [override virtual] Esri::ArcGISRuntime::LoadStatus ExportVectorTilesTask::loadStatus() const

    Reimplements: Loadable::loadStatus() const.

    See Loadable.

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

    Signal emitted when the load status changes for this object.

    See also Loadable.

    Esri::ArcGISRuntime::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.

    [override virtual] Esri::ArcGISRuntime::RequestConfiguration ExportVectorTilesTask::requestConfiguration() const

    Reimplements: RemoteResource::requestConfiguration() const.

    Returns the RequestConfiguration in use by this task.

    See also setRequestConfiguration().

    [override virtual] void ExportVectorTilesTask::retryLoad()

    Reimplements: Loadable::retryLoad().

    See Loadable.

    [override virtual, since Esri::ArcGISRuntime 100.10] void ExportVectorTilesTask::setApiKey(const QString &apiKey)

    Reimplements: ApiKeyResource::setApiKey(const QString &apiKey).

    Sets the API key to apiKey. See ApiKeyResource.

    This function was introduced in Esri::ArcGISRuntime 100.10.

    See also apiKey().

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

    Reimplements: RemoteResource::setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration).

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

    See also requestConfiguration().

    Esri::ArcGISRuntime::VectorTileSourceInfo ExportVectorTilesTask::sourceInfo() const

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

    [override virtual] QUrl ExportVectorTilesTask::url() const

    Reimplements: RemoteResource::url() const.

    Returns the URL for exporting vector tiles.

    This property can be the URL of:

    • A vector tile server that ends in "VectorTileServer" and is the REST endpoint 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.

    If the URL represents a PortalItem that can be used to download vector tiles or style resources, the portalItem property will be populated when the task is loaded.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.