DownloadPreplannedOfflineMapParameters Class

DownloadPreplannedOfflineMapJob."> DownloadPreplannedOfflineMapParameters Class | ArcGISQtCpp
  • DownloadPreplannedOfflineMapParameters
  • class Esri::ArcGISRuntime::DownloadPreplannedOfflineMapParameters

    The parameters that specify how an offline map area is downloaded from an online map using a DownloadPreplannedOfflineMapJob. More...

    Header: #include <DownloadPreplannedOfflineMapParameters.h>
    Since: Esri::ArcGISRuntime 100.4

    Public Functions

    DownloadPreplannedOfflineMapParameters(Esri::ArcGISRuntime::PreplannedMapArea *preplannedMapArea)
    DownloadPreplannedOfflineMapParameters(const Esri::ArcGISRuntime::DownloadPreplannedOfflineMapParameters &other)
    DownloadPreplannedOfflineMapParameters(Esri::ArcGISRuntime::DownloadPreplannedOfflineMapParameters &&other)
    bool isContinueOnErrors() const
    bool isIncludeBasemap() const
    Esri::ArcGISRuntime::PreplannedMapArea *preplannedMapArea(QObject *parent = nullptr) const
    QString referenceBasemapDirectory() const
    QString referenceBasemapFilename() const
    void setContinueOnErrors(bool continueOnErrors)
    void setIncludeBasemap(bool includeBasemap)
    void setPreplannedMapArea(Esri::ArcGISRuntime::PreplannedMapArea *preplannedMapArea)
    void setReferenceBasemapDirectory(const QString &referenceBasemapDirectory)
    void setReferenceBasemapFilename(const QString &referenceBasemapFilename)
    void setUpdateMode(Esri::ArcGISRuntime::PreplannedUpdateMode updateMode)
    Esri::ArcGISRuntime::PreplannedUpdateMode updateMode() const
    Esri::ArcGISRuntime::DownloadPreplannedOfflineMapParameters &operator=(const Esri::ArcGISRuntime::DownloadPreplannedOfflineMapParameters &other)
    Esri::ArcGISRuntime::DownloadPreplannedOfflineMapParameters &operator=(Esri::ArcGISRuntime::DownloadPreplannedOfflineMapParameters &&other)

    Detailed Description

    The online map must be a web map either on ArcGIS Online or ArcGIS Enterprise. Note that the API refers to an offline map area as a PreplannedMapArea.

    To generate default parameters that match the online map's offline settings, call OfflineMapTask::createDefaultDownloadPreplannedOfflineMapParametersAsync(Esri::ArcGISRuntime::PreplannedMapArea*). You can then modify the parameters with any desired changes. Alternatively, you can generate an empty set of parameters using DownloadPreplannedOfflineMapParameters and set the parameters individually. To create a DownloadPreplannedOfflineMapJob, pass the parameters to the OfflineMapTask::downloadPreplannedOfflineMap(const Esri::ArcGISRuntime::DownloadPreplannedOfflineMapParameters&, const QString&, QObject*) method and provide a path to a folder where the map content is stored on the device.

    Member Function Documentation


    Default constructor.

    [explicit] DownloadPreplannedOfflineMapParameters::DownloadPreplannedOfflineMapParameters(Esri::ArcGISRuntime::PreplannedMapArea *preplannedMapArea)

    Creates a download preplanned offline map parameters object with the given offline map area.

    • preplannedMapArea - preplanned map area representing area to be downloaded for offline use.

    DownloadPreplannedOfflineMapParameters::DownloadPreplannedOfflineMapParameters(const Esri::ArcGISRuntime::DownloadPreplannedOfflineMapParameters &other)

    Copy constructor from other DownloadPreplannedOfflineMapParameters.

    DownloadPreplannedOfflineMapParameters::DownloadPreplannedOfflineMapParameters(Esri::ArcGISRuntime::DownloadPreplannedOfflineMapParameters &&other)

    Move constructor from other DownloadPreplannedOfflineMapParameters.



    bool DownloadPreplannedOfflineMapParameters::isContinueOnErrors() const

    Returns whether or not the download preplanned offline map job should continue running in the event of failure to take a layer offline.

    If this property is true, failure to take a layer or table offline will not fail the job, the failure will be exposed in the job result. If this property is false, failure to take a layer or table offline will fail the job and no more layers or tables will be taken offline. The layer or table's error will be available as the job's error. The default value is true.

    bool DownloadPreplannedOfflineMapParameters::isIncludeBasemap() const

    Returns whether or not a basemap will be included in the offline map.

    If you do not want a basemap in the offline map then set this property to false.

    After loading the offline map, your application can programmatically insert a basemap into the map. Note that, a programmatically inserted basemap will not be persisted in the map.

    If you want a basemap in the offline map then set this property to true. You can choose to either:

    The default value is true.

    Esri::ArcGISRuntime::PreplannedMapArea *DownloadPreplannedOfflineMapParameters::preplannedMapArea(QObject *parent = nullptr) const

    Returns the offline map area that will be downloaded for offline use.

    The optional parent parameter will be set as the parent for the returned map area the first time this method is called.

    See also setPreplannedMapArea().

    [since Esri::ArcGISRuntime 100.5] QString DownloadPreplannedOfflineMapParameters::referenceBasemapDirectory() const

    Returns the path to a directory on the device where the local basemap file is located.

    Set this property to use a basemap which is already on the device (rather than downloading it). The directory should only be set when referenceBasemapFilename is defined.

    This property supports any directory specified as either:

    • An absolute path
    • A path relative to the parent directory of the generated mobile map package (see downloadPath for OfflineMapTask::downloadPreplannedOfflineMap(const Esri::ArcGISRuntime::DownloadPreplannedOfflineMapParameters&, const QString&, QObject*))

    If the directory does not exist, or does not contain the specified basemap, the DownloadPreplannedOfflineMapJob will fail.

    Note that, the mobile map package will store either a relative or absolute path to the reference basemap file so that it can be opened in the future.

    A relative path typically begins with "." to denote the parent directory of the resulting mobile map package or ".." to move up one directory. The parent directory of the mobile map package will be set when calling OfflineMapTask::generateOfflineMap(const Esri::ArcGISRuntime::GenerateOfflineMapParameters&, const QString&, QObject*).

    For example, to download a mobile map package to "[my root path]/my_offline_maps/my_mobile_map_package", which uses a reference basemap in "[my root path]/other_maps/my_basemap.tpk", you would set the relative path as follows:

    Note that, this property is ignored if isIncludeBasemap is false.

    This function was introduced in Esri::ArcGISRuntime 100.5.

    See also setReferenceBasemapDirectory.

    [since Esri::ArcGISRuntime 100.5] QString DownloadPreplannedOfflineMapParameters::referenceBasemapFilename() const

    Returns the name of a local basemap file on the device which can be used rather than downloading an online basemap.

    The local basemap filename must end with .tpk, .tpkx or .vtpk since these are the supported file formats. This property can be read directly from settings applied by the author of the online web map (see OfflineSettings) or set by user code to a file known to be on the device. This property will be populated from online settings when created with OfflineMapTask::createDefaultDownloadPreplannedOfflineMapParametersAsync(Esri::ArcGISRuntime::PreplannedMapArea*).

    If you wish to use the specified local basemap rather than downloading, you must also set referenceBasemapDirectory.

    If the directory does not exist, or does not contain the specified basemap filename, the DownloadPreplannedOfflineMapJob will fail.

    The spatial reference of the reference basemap is used for the offline map when it is different to the online map's spatial reference.

    Note that this property is ignored if isIncludeBasemap is false.

    This function was introduced in Esri::ArcGISRuntime 100.5.

    See also setReferenceBasemapFilename().

    void DownloadPreplannedOfflineMapParameters::setContinueOnErrors(bool continueOnErrors)

    Sets the continueOnErrors to continueOnErrors.

    See also isContinueOnErrors.

    void DownloadPreplannedOfflineMapParameters::setIncludeBasemap(bool includeBasemap)

    Sets the includeBasemap to includeBasemap.

    See also isIncludeBasemap.

    void DownloadPreplannedOfflineMapParameters::setPreplannedMapArea(Esri::ArcGISRuntime::PreplannedMapArea *preplannedMapArea)

    Sets the preplannedMapArea to preplannedMapArea.

    See also preplannedMapArea.

    [since Esri::ArcGISRuntime 100.5] void DownloadPreplannedOfflineMapParameters::setReferenceBasemapDirectory(const QString &referenceBasemapDirectory)

    Sets the referenceBasemapDirectory to referenceBasemapDirectory.

    This function was introduced in Esri::ArcGISRuntime 100.5.

    See also referenceBasemapDirectory.

    [since Esri::ArcGISRuntime 100.5] void DownloadPreplannedOfflineMapParameters::setReferenceBasemapFilename(const QString &referenceBasemapFilename)

    Sets the referenceBasemapFilename to referenceBasemapFilename.

    This function was introduced in Esri::ArcGISRuntime 100.5.

    See also referenceBasemapFilename.

    [since Esri::ArcGISRuntime 100.6] void DownloadPreplannedOfflineMapParameters::setUpdateMode(Esri::ArcGISRuntime::PreplannedUpdateMode updateMode)

    Sets the mode for the offline map will obtain feature updates from the online service to updateMode.

    This function was introduced in Esri::ArcGISRuntime 100.6.

    See also updateMode.

    [since Esri::ArcGISRuntime 100.6] Esri::ArcGISRuntime::PreplannedUpdateMode DownloadPreplannedOfflineMapParameters::updateMode() const

    Returns how the offline map will obtain feature updates from the online service.

    The preplanned workflow offers three modes for updating the feature data in your offline map:

    • Sync feature changes directly with online feature services.
    • Download a set of scheduled update packages (geodatabase delta files that are cached on the server) from the online map area.
    • Download scheduled updates from the online map area and upload new features to the feature service.

    To register your mobile geodatabases for syncing with online feature services, set this property to PreplannedUpdateMode::SyncWithFeatureServices. Syncing allows you to upload as well as download changes, so this approach should be used when you need full control to edit your data. As you sync changes directly with the back-end services, you will receive the most up-to-date feature data available. This is the default mode if you construct the DownloadPreplannedOfflineMapParameters.

    To download a set of cached updates (delta files) from the online map area, set this property to PreplannedUpdateMode::DownloadScheduledUpdates. With this approach, updates are generated whenever the online map area is refreshed - for example according to its update schedule. Updates are prepared once and cached for download by all users of the offline map area. Sharing a single set of cached updates, rather than performing individual sync operations, reduces the load on the back-end services - this makes this approach scalable for large deployments. As updates are only downloaded, this approach can only be used with read-only workflows. The updates also reflect a snapshot of the feature data at the time the online map area was refreshed - rather than the most up-to-date information. The web map author must configure the online map to store cached updates for this approach.

    To use a hybrid approach where you download scheduled updates and upload new features, set this property to PreplannedUpdateMode::DownloadScheduledUpdatesAndUploadNewFeatures. This approach combines the scalability of downloading scheduled updates with the ability to collect and share data in the field. Note that this approach is strictly add only, meaning that you cannot delete or edit features once they have been uploaded to the feature service.

    If you use a updateMode of PreplannedUpdateMode::DownloadScheduledUpdates or PreplannedUpdateMode::DownloadScheduledUpdatesAndUploadNewFeatures, with a web map that does not support scheduled updates, the resultant DownloadPreplannedOfflineMapJob will fail with an error Error::errorType of ErrorType::MappingScheduledUpdatesNotSupported.

    This function was introduced in Esri::ArcGISRuntime 100.6.

    See also setUpdateMode().

    Esri::ArcGISRuntime::DownloadPreplannedOfflineMapParameters &DownloadPreplannedOfflineMapParameters::operator=(const Esri::ArcGISRuntime::DownloadPreplannedOfflineMapParameters &other)

    Assignment operator from other DownloadPreplannedOfflineMapParameters.

    Esri::ArcGISRuntime::DownloadPreplannedOfflineMapParameters &DownloadPreplannedOfflineMapParameters::operator=(Esri::ArcGISRuntime::DownloadPreplannedOfflineMapParameters &&other)

    Move operator from other DownloadPreplannedOfflineMapParameters.

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