A job to download the offline map for an offline map area from a web map that is enabled for offline use and has offline map areas defined. More...
Header: | #include <DownloadPreplannedOfflineMapJob.h> |
Since: | Esri::ArcGISRuntime 100.2 |
Inherits: | Esri::ArcGISRuntime::Job |
Public Functions
virtual | ~DownloadPreplannedOfflineMapJob() override |
QString | downloadDirectoryPath() const |
Esri::ArcGISRuntime::Map * | onlineMap() const |
Esri::ArcGISRuntime::DownloadPreplannedOfflineMapParameters | parameters() const |
Esri::ArcGISRuntime::DownloadPreplannedOfflineMapResult * | result() const |
Detailed Description
This job is part of the ahead-of-time offline workflow. Use this job to download the offline map to your device so that you can work offline without a network connection. Note that offline map areas may also be referred to as preplanned map areas.
To make a DownloadPreplannedOfflineMapJob, use the OfflineMapTask as follows:
- Construct and load the OfflineMapTask with a web map that is enabled for offline use. For more information about enabling web maps for offline use see Take web maps offline.
- If necessary, check the web map's offline capabilities by using OfflineMapTask::offlineMapCapabilitiesAsync(const Esri::ArcGISRuntime::GenerateOfflineMapParameters&).
- Select an offline map area from the collection of offline map areas returned by OfflineMapTask::preplannedMapAreasAsync.
- Obtain the default DownloadPreplannedOfflineMapParameters for the offline map area by calling OfflineMapTask::createDefaultDownloadPreplannedOfflineMapParametersAsync(Esri::ArcGISRuntime::PreplannedMapArea*).
- Adjust any parameters, as required.
- Use the DownloadPreplannedOfflineMapParameters to create a DownloadPreplannedOfflineMapJob by calling OfflineMapTask::downloadPreplannedOfflineMap(const Esri::ArcGISRuntime::DownloadPreplannedOfflineMapParameters&, const QString&). You must specify a path to a folder where the map content will be stored on the device.
Start the DownloadPreplannedOfflineMapJob and monitor progress. Upon completion, the job's DownloadPreplannedOfflineMapResult provides the offline map along with the details of any errors incurred during the download process.
See the Job class for full information on how to work with jobs.
Relevant samples:
- Download a preplanned map area: Take a map offline using a preplanned map area.
Member Function Documentation
[override virtual]
DownloadPreplannedOfflineMapJob::~DownloadPreplannedOfflineMapJob ()
Destructor.
QString DownloadPreplannedOfflineMapJob::downloadDirectoryPath () const
Returns the directory path to the location of the mobile map package.
The directory path is the path that was supplied as a parameter to the OfflineMapTask::downloadPreplannedOfflineMap(const Esri::ArcGISRuntime::DownloadPreplannedOfflineMapParameters&, const QString&). The job will fail if the last directory in the path cannot be created or is not empty.
Esri::ArcGISRuntime::Map *DownloadPreplannedOfflineMapJob::onlineMap () const
Returns the online map used by this job.
[since Esri::ArcGISRuntime 100.4]
Esri::ArcGISRuntime::DownloadPreplannedOfflineMapParameters DownloadPreplannedOfflineMapJob::parameters() const
Returns the preplanned map parameters used to create this job.
This function was introduced in Esri::ArcGISRuntime 100.4.
Esri::ArcGISRuntime::DownloadPreplannedOfflineMapResult *DownloadPreplannedOfflineMapJob::result() const
Returns the result of a download preplanned offline map job that has succeeded.
Although this job will have succeeded you must confirm whether any of the map content failed to be taken offline. Examine DownloadPreplannedOfflineMapResult::hasErrors and the DownloadPreplannedOfflineMapResult::layerErrors and DownloadPreplannedOfflineMapResult::tableErrors dictionaries to identify layers and tables that could not be taken offline.