Represents a single preplanned offline map area. More...
Header: | #include <PreplannedMapArea.h> |
Since: | Esri::ArcGISRuntime 100.2 |
Inherits: | Esri::ArcGISRuntime::Object and Esri::ArcGISRuntime::Loadable |
This class was introduced in Esri::ArcGISRuntime 100.2.
Public Functions
PreplannedMapArea(Esri::ArcGISRuntime::PortalItem *portalItem, QObject *parent = nullptr) | |
virtual | ~PreplannedMapArea() override |
Esri::ArcGISRuntime::Geometry | areaOfInterest() const |
Esri::ArcGISRuntime::ImmutablePortalItemListModel * | packageItems() const |
Esri::ArcGISRuntime::PreplannedPackagingStatus | packagingStatus() const |
Esri::ArcGISRuntime::PortalItem * | portalItem() const |
Esri::ArcGISRuntime::OfflineMapUpdateCapabilities * | updateCapabilities() const |
Reimplemented Public Functions
virtual void | cancelLoad() override |
virtual void | load() override |
virtual Esri::ArcGISRuntime::Error | loadError() const override |
virtual Esri::ArcGISRuntime::LoadStatus | loadStatus() const override |
virtual void | retryLoad() override |
Signals
void | contentItemsCompleted(QUuid taskId, Esri::ArcGISRuntime::ImmutablePortalItemListModel *contentItems) |
void | doneLoading(Esri::ArcGISRuntime::Error loadError) |
void | loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus) |
Detailed Description
Offline map areas are specific work areas or major incident areas that are defined by an online map author ahead of time. Each online map can contain a number of offline map areas. These can be provided in a list by the OfflineMapTask::preplannedMapAreas method.
Each offline map area uses map content that is stored online. Download this map content by running a OfflineMapTask::downloadPreplannedOfflineMap. Create this job by passing the offline map area to the OfflineMapTask::downloadPreplannedOfflineMap method on the OfflineMapTask.
To successfully load a PreplannedMapArea the PreplannedMapArea::packagingStatus must be PreplannedPackagingStatus}{PreplannedPackagingStatus::Complete}.
Member Function Documentation
PreplannedMapArea::PreplannedMapArea (Esri::ArcGISRuntime::PortalItem *portalItem , QObject *parent = nullptr)
Constructor that accepts a PortalItem (portalItem) and an optional parent.
Use this constructor to create an offline map area instance with a portal item that is of type map area.
[signal]
void PreplannedMapArea::contentItemsCompleted (QUuid taskId , Esri::ArcGISRuntime::ImmutablePortalItemListModel *contentItems )
Signal emitted when contentItems completes.
- taskId - The task ID that this signal corresponds to.
- contentItems - A list model containing the fetched content items.
The returned ImmutablePortalItemListModel object has the PreplannedMapArea as its parent.
This function was introduced in Esri::ArcGISRuntime 100.3.
See also Returned QObjects Parenting.
[signal]
void PreplannedMapArea::doneLoading (Esri::ArcGISRuntime::Error loadError )
Signal emitted when this object is done loading.
- loadError - Details about any error that may have occurred.
Note: If there is a load error it will also be emitted on the errorOccurred
signal.
[signal]
void PreplannedMapArea::loadStatusChanged (Esri::ArcGISRuntime::LoadStatus loadStatus )
Signal emitted when the loadStatus changes for this object.
See also Loadable.
[override virtual]
PreplannedMapArea::~PreplannedMapArea ()
Destructor.
Esri::ArcGISRuntime::Geometry PreplannedMapArea::areaOfInterest () const
Returns the area of interest bounding the offline map area.
The area of interest is returned as a Geometry, which can be either an Envelope or a Polygon depending on how the online map was created.
[override virtual]
void PreplannedMapArea::cancelLoad ()
Reimplements: Loadable::cancelLoad().
See Loadable.
[override virtual]
void PreplannedMapArea::load()
Reimplements: Loadable::load().
See Loadable.
[override virtual]
Esri::ArcGISRuntime::Error PreplannedMapArea::loadError () const
Reimplements: Loadable::loadError() const.
See Loadable.
[override virtual]
Esri::ArcGISRuntime::LoadStatus PreplannedMapArea::loadStatus () const
Reimplements: Loadable::loadStatus() const.
See Loadable.
Esri::ArcGISRuntime::ImmutablePortalItemListModel *PreplannedMapArea::packageItems () const
Returns the portal items for packages related to this preplanned map area.
When the offline map area has successfully loaded, this collection contains the portal items for the packages (tile packages or geodatabases) holding the offline data for the preplanned map area.
This function was introduced in Esri::ArcGISRuntime 100.14.
Esri::ArcGISRuntime::PreplannedPackagingStatus PreplannedMapArea::packagingStatus () const
Returns the publishing status of the online map area.
This property allows you to check whether an online PreplannedMapArea is in a PreplannedPackagingStatus::Complete state and ready to be downloaded.
There are four possible values:
- PreplannedPackagingStatus::Unknown indicates that the metadata for the map area has not been fetched. This will be the value when the map area is LoadStatus::NotLoaded.
- PreplannedPackagingStatus::Processing indicates that the online map area is not yet ready to be downloaded. The packages required for the map area have not been packaged yet.
- PreplannedPackagingStatus::Failed indicates that an error was encountered while preparing the online map area or its packages. In this scenario, the map area cannot be downloaded until the web map author has resolved the errors.
- PreplannedPackagingStatus::Complete indicates the map area is ready for download and the data has been packaged.
If you attempt to download a PreplannedMapArea that is not PreplannedPackagingStatus::Complete the DownloadPreplannedOfflineMapJob will fail with Error::errorType {Esri::ArcGISRuntime::ErrorType} {ErrorType::MappingPackagingNotComplete}.
If you attempt to create a set of DownloadPreplannedOfflineMapParameters by calling OfflineMapTask::createDefaultDownloadPreplannedOfflineMapParameters from a PreplannedMapArea that is not PreplannedPackagingStatus::Complete, the operation will also fail with Error::errorType {Esri::ArcGISRuntime::ErrorType} {ErrorType::MappingPackagingNotComplete}.
If the packaging status is PreplannedPackagingStatus::Processing you can check it again following these steps:
- 1. Create a new PortalItem instance using the url in the portalItem.
- 2. Create a new PreplannedMapArea using the portal item.
- 3. Load the PreplannedMapArea and check packagingStatus.
This function was introduced in Esri::ArcGISRuntime 100.9.
Esri::ArcGISRuntime::PortalItem *PreplannedMapArea::portalItem () const
Returns the portal item that this offline map area was created from.
[override virtual]
void PreplannedMapArea::retryLoad ()
Reimplements: Loadable::retryLoad().
See Loadable.
Esri::ArcGISRuntime::OfflineMapUpdateCapabilities *PreplannedMapArea::updateCapabilities () const
Returns the methods for obtaining updates that are supported for this preplanned map area.
There are two approaches for updating the features in a preplanned offline map area:
- Syncing directly with feature services.
- Downloading scheduled updates (or update packages) from the online map area.
Choose the approach that best suits your workflow, then select the appropriate DownloadPreplannedOfflineMapParameters::updateMode. For more details on how to update an offline map, see the OfflineMapSyncTask.
If OfflineMapUpdateCapabilities::isSupportsSyncWithFeatureServices is true
, you can sync directly with feature services. This mode gives you full control over when you upload and download changes. However, performing a download sync places significant load on the backing feature service, so this approach does not scale well for very large deployments. Set the DownloadPreplannedOfflineMapParameters::updateMode to PreplannedUpdateMode::SyncWithFeatureServices to use this approach.
If OfflineMapUpdateCapabilities::isSupportsScheduledUpdatesForFeatures is true
, you can download read-only update packages from the online map area. Updates are prepared on a regular schedule 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 approach is scalable for large deployments but does not support offline editing. Set the DownloadPreplannedOfflineMapParameters::updateMode to PreplannedUpdateMode::DownloadScheduledUpdates to use this approach.
Note that scheduled updates is an optimization that must be enabled by the web map author when the map area is created.
If both of the above OfflineMapUpdateCapabilities are true
, and the feature services in your online map support creating new features, you can adopt a hybrid update model where you download read-only update packages while uploading new features directly to the feature service. This approach combines the scalability of downloading scheduled updates with the ability to collect data in the field. However, 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. Set the DownloadPreplannedOfflineMapParameters::updateMode to PreplannedUpdateMode::DownloadScheduledUpdatesAndUploadNewFeatures to use this approach.
This property will return nullptr
until the offline map area is loaded.
This function was introduced in Esri::ArcGISRuntime 100.6.0.