A job that estimates the size of a tile cache (.tpk or .tpkx) that can be exported from a map or image service. More...
Header: | #include <EstimateTileCacheSizeJob.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | Esri::ArcGISRuntime::Job |
Public Functions
virtual | ~EstimateTileCacheSizeJob() override |
Esri::ArcGISRuntime::EstimateTileCacheSizeResult * | result() const |
Detailed Description
Use the EstimateTileCacheSizeJob to get the approximate size of a tile cache for a specific set of ExportTileCacheParameters. Note that time required to create a tile cache varies depending on the extent requested, the number of levels requested, the network connection speed, and so on. When planning a large offline data capture event, generate a smaller tile cache to get an idea of how long caching will take.
To make an EstimateTileCacheSizeJob, use the ExportTileCacheTask as follows:
- Confirm that the map or image service can export tiles by checking ArcGISMapServiceInfo::isExportTileCacheCompactV2Allowed for the compact version 2 format (.tpkx) and ArcGISMapServiceInfo::isExportTilesAllowed for the legacy format (.tpk).
- Construct and load the ExportTileCacheTask with the map or image service.
- Create a Geometry to define the area of interest that you wish to take offline.
- Obtain the default ExportTileCacheParameters by calling ExportTileCacheTask::createDefaultExportTileCacheParametersAsync(const Esri::ArcGISRuntime::Geometry&, double, double) with the area of interest and a minimum and maximum scale for the tile cache.
- Use the ExportTileCacheParameters to create an EstimateTileCacheSizeJob by calling ExportTileCacheTask::estimateTileCacheSize(const Esri::ArcGISRuntime::ExportTileCacheParameters&).
Start the EstimateTileCacheSizeJob and monitor progress. Upon completion, the job's EstimateTileCacheSizeResult provides an estimate of the number and size of files in the tile cache.
See the Job class for full information on how to work with jobs.
Member Function Documentation
[override virtual]
EstimateTileCacheSizeJob::~EstimateTileCacheSizeJob ()
Destructor.
Esri::ArcGISRuntime::EstimateTileCacheSizeResult *EstimateTileCacheSizeJob::result() const
Returns for a successfully completed job the result returns an estimate of the tile cache size. Otherwise empty is returned.
If the job is in progress then a empty result is returned until the job successfully completes.