A job that generates and downloads the offline map for a specific area of interest from a web map that is enabled for offline use. More...
Header: | #include <GenerateOfflineMapJob.h> |
Since: | Esri::ArcGISRuntime 100.1 |
Inherits: | Esri::ArcGISRuntime::Job |
Public Functions
virtual | ~GenerateOfflineMapJob() override |
QString | downloadDirectoryPath() const |
Esri::ArcGISRuntime::Map * | onlineMap() const |
Esri::ArcGISRuntime::GenerateOfflineMapParameterOverrides * | parameterOverrides() const |
Esri::ArcGISRuntime::GenerateOfflineMapParameters | parameters() const |
Esri::ArcGISRuntime::GenerateOfflineMapResult * | result() const |
Detailed Description
This job is part of the on-demand offline workflow. Use this job to generate and download the offline map to your device so that you can work offline without a network connection.
To make a GenerateOfflineMapJob, 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&).
- Create a Geometry to define the area of interest that you wish to take offline.
- Obtain the default GenerateOfflineMapParameters for the area of interest by calling OfflineMapTask::createDefaultGenerateOfflineMapParametersAsync(const Esri::ArcGISRuntime::Geometry&).
- Use the GenerateOfflineMapParameters to create a GenerateOfflineMapJob by calling OfflineMapTask::generateOfflineMap(const Esri::ArcGISRuntime::GenerateOfflineMapParameters&, const QString&). You must specify a path to a folder where the map content will be stored on the device.
Start the GenerateOfflineMapJob and monitor progress. Upon completion, the job's GenerateOfflineMapResult provides the offline map along with the details of any errors incurred during the generate and download process.
See the Job class for full information on how to work with jobs.
Relevant samples:
- Generate offline map: Take a web map offline.
- Generate Offline Map (Overrides): Take a web map offline with additional options for each layer.
- Generate offline map with local basemap: Use the `OfflineMapTask` to take a web map offline, but instead of downloading an online basemap, use one which is already on the device.
Member Function Documentation
[override virtual]
GenerateOfflineMapJob::~GenerateOfflineMapJob ()
Destructor.
QString GenerateOfflineMapJob::downloadDirectoryPath () const
Returns the download directory used by this job to write the mobile map package result.
This property holds the path for the mobile map package which will be generated as a result of running this job.
As the job's result returns an offline map, this same path can be used to instantiate the MobileMapPackage for later use.
Esri::ArcGISRuntime::Map *GenerateOfflineMapJob::onlineMap () const
Returns the online map used by this job.
[since Esri::ArcGISRuntime 100.4]
Esri::ArcGISRuntime::GenerateOfflineMapParameterOverrides *GenerateOfflineMapJob::parameterOverrides () const
Returns the GenerateOfflineMapParameterOverrides used by this job (if set).
Returns nullptr
if no overrides are set.
This function was introduced in Esri::ArcGISRuntime 100.4.
Esri::ArcGISRuntime::GenerateOfflineMapParameters GenerateOfflineMapJob::parameters() const
Returns the GenerateOfflineMapParameters used by this job.
Esri::ArcGISRuntime::GenerateOfflineMapResult *GenerateOfflineMapJob::result() const
Returns the GenerateOfflineMapResult.
If the job has not succeeded a empty is returned.