OfflineMapTask

A task used to take a map offline. Taking a map offline involves downloading an online map and its data, including all the supported layers, tables, renderers, web map configuration etc. so that it can 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. Download the offline map content to a device using the DownloadPreplannedOfflineMapJob. Note that this API refers to an offline map area as a PreplannedMapArea. For more information about authoring offline map areas, see https://doc.arcgis.com/en/arcgis-online/manage-data/take-maps-offline.htm.

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.

Since

200.1.0

Constructors

Link copied to clipboard
constructor(onlineMap: ArcGISMap)

Create the offline map task for the provided online map. The online map must represent a web map. The online map must be of type PortalItemType.WebMap, either on ArcGIS Online or an on-premise ArcGIS Enterprise Portal.

constructor(portalItem: PortalItem)

Creates the offline map task with the provided portal item. The portal item must represent a web map. The PortalItem must be of type PortalItemType.WebMap, either on ArcGIS Online or an on-premise ArcGIS Enterprise Portal.

Properties

Link copied to clipboard

The online map to be taken offline. The online map will be of type PortalItemType.WebMap, either on ArcGIS Online or an on-premise ArcGIS Enterprise Portal.

Link copied to clipboard

The portal item that specifies the map to be taken offline. The PortalItem will be of type PortalItemType.WebMap, either on ArcGIS Online or an on-premise ArcGIS Enterprise Portal

Inherited properties

Link copied to clipboard
open override val loadStatus: StateFlow<LoadStatus>

The load status.

Functions

Returns a Result of DownloadPreplannedOfflineMapParameters created from the specified PreplannedMapArea. A convenience method to create DownloadPreplannedOfflineMapParameters with default values appropriate for taking the specified map area offline.

suspend fun createDefaultGenerateOfflineMapParameters(areaOfInterest: Geometry, minScale: Double = 0.0, maxScale: Double = 0.0): Result<GenerateOfflineMapParameters>

Returns a Result of GenerateOfflineMapParameters created from the specified area of interest, min scale and max scale.

Link copied to clipboard

Returns a job that is used to download the preplanned map area specified by the given parameters object. 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.

Link copied to clipboard

Returns a job that is used to generate an offline map using the specified parameters and overrides. 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.

Returns a Result of GenerateOfflineMapParameterOverrides created from the specified GenerateOfflineMapParameters parameters. 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(GenerateOfflineMapParameters, String, GenerateOfflineMapParameterOverrides).

Link copied to clipboard

Returns an async Result which, when successful, returns the OfflineMapCapabilities containing information on which layers will be included in an offline map.

Link copied to clipboard

Returns an async Result which when successful, contains a list of preplanned map areas, if there are any. Note that calling this method will load the OfflineMapTask if it is not already loaded.

Inherited functions

Link copied to clipboard
open override fun cancelLoad()

Cancels loading metadata for the Loadable object.

Link copied to clipboard
open suspend override fun load(): Result<Unit>

Loads the metadata for the object.

Link copied to clipboard
open suspend override fun retryLoad(): Result<Unit>

Loads or retries loading metadata for the object.