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. More...
Header | #include <Export |
Since | Esri |
Inherits | Esri |
Public Functions
virtual | ~ |
Q | item |
Esri | parameters() const |
Esri | result() const |
Q | vector |
Detailed Description
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::createDefaultExportVectorTilesParametersAsync(const Esri::ArcGISRuntime::Geometry&, double) 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 download a vector tile package and its default style resources, call ExportVectorTilesTask::exportVectorTiles(const Esri::ArcGISRuntime::ExportVectorTilesParameters&, const QString&).
- To download a vector tile package and its custom style resources, call ExportVectorTilesTask::exportVectorTiles(const Esri::ArcGISRuntime::ExportVectorTilesParameters&, const QString&, const QString&).
- To download custom style resources associated with the task's vector tile service, call ExportVectorTilesTask::exportStyleResourceCache(const QString&).
To export the vector tiles and/or custom styles, start the ExportVectorTilesJob, monitor progress, and examine the result when the job completes successfully.
Use the ExportVectorTilesResult::vectorTileCache in the ArcGISVectorTiledLayer::ArcGISVectorTiledLayer(Esri::ArcGISRuntime::VectorTileCache*, QObject*) to create an ArcGIS vector tiled layer. If you downloaded a custom style, use the ExportVectorTilesResult::itemResourceCache in the ArcGISVectorTiledLayer::ArcGISVectorTiledLayer(Esri::ArcGISRuntime::VectorTileCache*, Esri::ArcGISRuntime::ItemResourceCache*, QObject*).
Relevant samples:
- Export vector tiles: Export tiles from an online vector tile service.
Member Function Documentation
[override virtual noexcept]
ExportVectorTilesJob::~ExportVectorTilesJob ()
Destructor.
QString ExportVectorTilesJob::itemResourcePath () const
Returns the path that the downloaded vector tile style is saved to.
If this job was created with ExportVectorTilesTask::exportVectorTiles(const Esri::ArcGISRuntime::ExportVectorTilesParameters&, const QString&), this will be an empty string.
Esri::ArcGISRuntime::ExportVectorTilesParameters ExportVectorTilesJob::parameters() const
The parameters used by the job.
Esri::ArcGISRuntime::ExportVectorTilesResult *ExportVectorTilesJob::result() const
Returns the result of the successfully completed job (ExportVectorTilesJob).
If the job is successful then result will contain the downloaded vector tile cache. Otherwise empty is returned. If the job is in progress then a empty result is returned until the job successfully completes.
QString ExportVectorTilesJob::vectorTileCachePath () const
Returns 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::exportStyleResourceCache(const QString&), this will be an empty string.