OfflineMapTask QML Type

A task with methods related to taking a map offline and synchronizing online and offline maps. More...

Import Statement: import Esri.ArcGISRuntime 100.15
Since: Esri.ArcGISRuntime 100.1
Inherits:

Object

Properties

Signals

Methods

Detailed Description

Taking a map offline involves downloading an online map and its data, including all the supported layers, tables, renderers, web map configuration and so on, so that the map may be used offline without a network connection.

There are two workflows available for taking maps offline:

  • The ahead-of-time workflow (also sometimes referred to as the preplanned workflow).
  • the on-demand workflow

Ahead-of-time workflow. In this workflow the author of a web map defines geographical areas (offline map areas) to take offline. ArcGIS Online, or ArcGIS Enterprise, uses these to prepare offline map content that is stored online. ArcGIS Runtime apps download the offline map content to a device using the DownloadPreplannedOfflineMapJob. Note that ArcGIS Runtime APIs refer to an offline map area as a PreplannedMapArea. For more information about authoring offline map areas, see Take web maps offline.

On-demand workflow. Here, the app passes a specific area of interest to a GenerateOfflineMapJob to generate and download the map content to the device. Using this workflow, you can choose to keep online only services (e.g., those that require a network connection) in your offline map. Be aware that an offline map which uses online only services will require a network connection and may require authentication.

This object may be instantiated with an onlineMap or a portalItem, but not with both.

This QML type supports the following default properties. A default property may be declared inside another declared object without being assigned explicitly to a property.

TypeDefault Property
Credentialcredential (deprecated since Esri.ArcGISRuntime 100.13)
RequestConfigurationrequestConfiguration (deprecated since Esri.ArcGISRuntime 100.13)
MaponlineMap
PortalItemportalItem

See also Loadable, Cancelable, and RemoteResource.

Property Documentation

createDefaultDownloadPreplannedOfflineMapParametersResult : DownloadPreplannedOfflineMapParameters

Returns the results of getting the parameters for downloading a preplanned offline map (read-only).

The results are from a task used to generate DownloadPreplannedOfflineMapParameters for a preplanned area.

This property was introduced in Esri::ArcGISRuntime 100.5.


createDefaultDownloadPreplannedOfflineMapParametersStatus : Enums.TaskStatus

Returns a Enums.TaskStatus of the DownloadPreplannedOfflineMapParameters task (read-only).

This property was introduced in Esri.ArcGISRuntime 100.5.


createDefaultGenerateOfflineMapParametersResult : GenerateOfflineMapParameters

Returns the results from getting the default parameters for taking a map offline (read-only).

The results are from a task used to generate GenerateOfflineMapParameters for an area of interest.


createDefaultGenerateOfflineMapParametersStatus : Enums.TaskStatus

Returns a Enums.TaskStatus of the GenerateOfflineMapParameters task (read-only).


createGenerateOfflineMapParameterOverridesResult : GenerateOfflineMapParameterOverrides

Returns the results from getting the parameter overrides for taking a map offline (read-only).

The results are from a task used to generate GenerateOfflineMapParameterOverrides from a set of GenerateOfflineMapParameters.

This property was introduced in Esri::ArcGISRuntime 100.4.


createGenerateOfflineMapParameterOverridesStatus : Enums.TaskStatus

Returns a Enums.TaskStatus of the GenerateOfflineMapParameterOverrides task (read-only).

This property was introduced in Esri.ArcGISRuntime 100.4.


loadError : Error

Returns the load error (read-only).

Note: load errors are also reported on the error property and emit the errorChanged signal.

See also Loadable and Object.


loadStatus : Enums.LoadStatus

Returns the load status (read-only).

See also Loadable and Enums.LoadStatus.


offlineMapCapabilitiesResult : OfflineMapCapabilities

Returns the results from getting the capabilities of an offline map (read-only).

The results are from a task created with offlineMapCapabilities, used to generate capabilities of an offline map.


offlineMapCapabilitiesStatus : Enums.TaskStatus

Returns a Enums.TaskStatus of offlineMapCapabilities (read-only).


[default] onlineMap : Map

The online map within this task.

An OfflineMapTask object may be instantiated with an onlineMap or a portalItem, but not with both.


[default] portalItem : PortalItem

The portal item specifying the map to be taken offline.

An OfflineMapTask object may be instantiated with an onlineMap or a portalItem, but not with both.

The PortalItem must be of type PortalItemType::WebMap, either on ArcGIS Online or an on-premise ArcGIS Enterprise Portal.


preplannedMapAreaList : PreplannedMapAreaListModel

Returns the list of preplanned map areas populated by preplannedMapAreas.

Calling this method will load the OfflineMapTask if it is not already loaded.

This property was introduced in Esri.ArcGISRuntime 100.2.

See also PreplannedMapArea.


preplannedMapAreasStatus : Enums.TaskStatus

Returns a Enums.TaskStatus of the preplannedMapAreas task (read-only).

This property was introduced in Esri.ArcGISRuntime 100.2.


url : url

This inherited property is unused with OfflineMapTask.


Signal Documentation

createDefaultDownloadPreplannedOfflineMapParametersStatusChanged()

Emitted when the createDefaultDownloadPreplannedOfflineMapParametersStatus property or the createDefaultGenerateOfflineMapParametersResult property changes.

Note: The corresponding handler is onCreateDefaultDownloadPreplannedOfflineMapParametersStatusChanged.

This signal was introduced in Esri.ArcGISRuntime 100.5.


createDefaultGenerateOfflineMapParametersStatusChanged()

Emitted when the createDefaultGenerateOfflineMapParametersStatus property or the createDefaultGenerateOfflineMapParametersResult property changes.

Note: The corresponding handler is onCreateDefaultGenerateOfflineMapParametersStatusChanged.


createGenerateOfflineMapParameterOverridesStatusChanged()

Emitted when the createGenerateOfflineMapParameterOverridesStatus property or the createGenerateOfflineMapParameterOverridesResult property changes.

Note: The corresponding handler is onCreateGenerateOfflineMapParameterOverridesStatusChanged.

This signal was introduced in Esri.ArcGISRuntime 100.4.


loadErrorChanged()

Emitted when the loadError property changes.

Note: The corresponding handler is onLoadErrorChanged.

See also Loadable and Object.


loadStatusChanged()

Emitted when the loadStatus property changes.

Note: The corresponding handler is onLoadStatusChanged.

See also Loadable.


offlineMapCapabilitiesStatusChanged()

Emitted when the offlineMapCapabilitiesStatus property or the offlineMapCapabilitiesResult property changes.

Note: The corresponding handler is onOfflineMapCapabilitiesStatusChanged.


onlineMapChanged()

Emitted when the onlineMap property changes.

Note: The corresponding handler is onOnlineMapChanged.


portalItemChanged()

Emitted when the portalItem property changes.

Note: The corresponding handler is onPortalItemChanged.


preplannedMapAreasStatusChanged()

Emitted when the preplannedMapAreasStatus property changes.

Note: The corresponding handler is onPreplannedMapAreasStatusChanged.

This signal was introduced in Esri.ArcGISRuntime 100.2.


urlChanged()

Emitted when the url property changes.

Note: The corresponding handler is onUrlChanged.


Method Documentation

void cancelLoad()

See also Loadable.


bool cancelTask(string taskId)

Cancel the task with the ID taskId.

Returns false if the task cannot be canceled or there is no task with the specified id taskId.

See also Cancelable.


string createDefaultDownloadPreplannedOfflineMapParameters(PreplannedMapArea area)

Gets DownloadPreplannedOfflineMapParameters with default values appropriate for taking the specified area offline.

  • area - The offline map area that is to be downloaded from the online map.

This method returns a string representing the task ID of the task.

Uses an asynchronous task to get the default parameters, which are returned in the createDefaultDownloadPreplannedOfflineMapParametersResult property when the task completes. Wait for the createDefaultDownloadPreplannedOfflineMapParametersStatusChanged signal to emit and the createDefaultGenerateOfflineMapParametersStatus to be Enums.TaskStatusCompleted before retrieving the result.

If the web map author has set a reference basemap filename, this will be set into the DownloadPreplannedOfflineMapParameters::referenceBasemapFilename property.

This method was introduced in Esri::ArcGISRuntime 100.5.


string createDefaultGenerateOfflineMapParameters(Geometry areaOfInterest)

Returns a string of GenerateOfflineMapParameters created from the specified area of interest.

  • areaOfInterest - the region of the online map that is to be taken offline.

The supported geometry types for the area of interest are Envelope and Polygon. The area of interest must have a spatial reference.

Where a Polygon is supplied, features and tiles will be filtered according to the polygon geometry, which can help reduce the size of the resulting offline map. Note that the filtered set of tiles may vary, depending on the underlying service.

The returned parameters min scale and max scale are zero so data will be taken at the full range of scales the services support.

The returned GenerateOfflineMapParameters has its itemInfo property initialized from the offline map task's portal item, if that is set.

The ItemInfo's thumbnail will be copied from the portal item's thumbnail.

The default parameters will be populated using the values in the online map's OfflineSettings (if present).

Returns a string representing the task ID of the asynchronous task.


string createDefaultGenerateOfflineMapParametersWithScale(Geometry areaOfInterest, double minScale, double maxScale)

Gets the default parameters for taking a map offline.

  • areaOfInterest - The geographic area of interest for the offline map. The area of interest must have a spatial reference.
  • minScale - The minimum scale for offline tile caches. Use 0 for all far out levels. Sets the property GenerateOfflineMapParameters::minScale.
  • maxScale - The maximum scale for offline tile caches. Use 0 for all closer in detailed levels. Sets the property GenerateOfflineMapParameters::maxScale.

This method returns a string representing the task ID of the task.

Uses an asynchronous task to get the default parameters, which are returned in the createDefaultGenerateOfflineMapParametersResult property when the task completes. Wait for the createDefaultGenerateOfflineMapParametersStatusChanged signal to emit and the createDefaultGenerateOfflineMapParametersStatus to be Enums.TaskStatusCompleted before retrieving the result.

This will populate the parameters with default values for all the input parameters defined by the service. If the service defines a default value for a parameter, this will be used. If no default value is defined for a parameter, it will be given an appropriate default for its type: Boolean parameters - false, string parameters - an empty string, and numerical parameters - zero.

The supported geometry types for the area of interest are Envelope and Polygon. The area of interest must have a spatial reference. Where a Polygon is supplied, features and tiles will be filtered according to the polygon geometry, which can help reduce the size of the resulting offline map. Note that the filtered set of tiles may vary, depending on the underlying service.

The returned GenerateOfflineMapParameters has its itemInfo property initialized from the offline map task's portal item, if that is set. The item info's thumbnail will be copied from the portal item's thumbnail.

This method was introduced in Esri::ArcGISRuntime 100.4.


string createGenerateOfflineMapParameterOverrides(GenerateOfflineMapParameters parameters)

Asynchronously retrieves a GenerateOfflineMapParameterOverrides created from the specified parameters.

  • parameters - The generate offline map parameters from which the overrides will be populated.

When the task completes the GenerateOfflineMapParameterOverrides will be populated reflecting the values in the GenerateOfflineMapParameters parameters. The overrides may be inspected and modified to change the offline data before passing onto creating a job with OfflineMapTask::generateOfflineMap.

If there are errors with loading individual layers or tables, or they cannot be taken offline due to service settings, the outcome depends on the value of GenerateOfflineMapParameters::continueOnErrors.

  • If this property is true, the overrides correspond to the remaining layers and tables that can go offline. The resulting offline map will not contain the layers or tables which had errors.
  • If this property is false, the task will fail with an Error from the failed layer or table.

To check upfront which layers or tables are valid for taking offline, see offlineMapCapabilities.

If GenerateOfflineMapParameters::referenceBasemapDirectory is set, the overrides corresponding to online basemap layers will be omitted, since no basemap layers will be downloaded.

Uses an asynchronous task to get the parameter overrides, which are returned in the createGenerateOfflineMapParameterOverridesResult property when the task completes. Wait for the createGenerateOfflineMapParameterOverridesStatusChanged signal to emit and the createGenerateOfflineMapParameterOverridesStatus to be Enums.TaskStatusCompleted before retrieving the result.

This method was introduced in Esri::ArcGISRuntime 100.4.


DownloadPreplannedOfflineMapJob downloadPreplannedOfflineMapWithParameters(DownloadPreplannedOfflineMapParameters parameters, url downloadDirectoryPath)

Returns a job that is used to download the specified preplanned map area of an online map.

  • parameters - Specifies the offline map area to be downloaded.
  • downloadDirectoryPath - The url to a folder where the map content is stored on the device. For example, to create a new mobile map package "my_mobile_map_package" in a parent directory "[my root path]/my_mobile_maps", this property would be "[my root path]/my_mobile_maps/my_mobile_map_package".

Note: The job that is returned is not started and needs to be explicitly started. The job will fail if the last directory in the download directory path cannot be created or is not empty.

This method was introduced in Esri.ArcGISRuntime 100.4.


GenerateOfflineMapJob generateOfflineMap(GenerateOfflineMapParameters parameters, url downloadDirectoryPath)

Create a Job to run this OfflineMapTask.

  • parameters - The set of parameters to use to generate the offline content.
  • downloadDirectoryPath - The url to a folder where the map content is stored on the device. For example, to create a new mobile map package "my_mobile_map_package" in a parent directory "[my root path]/my_mobile_maps", this property would be "[my root path]/my_mobile_maps/my_mobile_map_package".

Returns a GenerateOfflineMapJob. Start this job to begin generating the offline map.


GenerateOfflineMapJob generateOfflineMapWithOverrides(GenerateOfflineMapParameters parameters, url downloadDirectoryPath, GenerateOfflineMapParameterOverrides parameterOverrides)

Returns a job that is used to generate an offline map using the specified parameters and overrides.

  • parameters - Parameters to specify how to take a map offline. For example, specify the area of interest, min and max scale, layer attachment options. Note that any properties relating to layers should be taken offline will be ignored and the values in the parameterOverrides will be used instead.
  • downloadDirectoryPath - The url to a folder where the map content is stored on the device. For example, to create a new mobile map package "my_mobile_map_package" in a parent directory "[my root path]/my_mobile_maps", this property would be "[my root path]/my_mobile_maps/my_mobile_map_package".
  • parameterOverrides. The overrides to the parameters which control how individual services are taken offline. These take precedence over settings in the parameters.

The job that is returned is dormant and needs to be explicitly started. The job will fail if the last directory in the download directory path cannot be created or is not empty. The GenerateOfflineMapParameterOverrides allows more control over the extracted data. To create an instance GenerateOfflineMapParameterOverrides use OfflineMapTask::createGenerateOfflineMapParameterOverrides.

Some properties on GenerateOfflineMapParameters will be ignored when using GenerateOfflineMapParameterOverrides and replaced with equivalent properties for each service. The overridden properties are:

This method was introduced in Esri::ArcGISRuntime 100.4.


void load()

See also Loadable.


string offlineMapCapabilities(GenerateOfflineMapParameters parameters)

Asynchronously retrieves information about which layers and tables in the map can be taken offline as specified in parameters.

Returns a string representing the task ID of the asynchronous task. Information reveals which layers will be included in an offline map.


string preplannedMapAreas()

Asynchronously retrieves a list of preplanned map areas, if there are any.

Returns a string representing the task ID of the asynchronous task.

This method was introduced in Esri.ArcGISRuntime 100.2.


void retryLoad()

See also Loadable.


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