OfflineMapTask QML Type

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

    Import Statement: import Esri.ArcGISRuntime
    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 offline 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 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 that 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
    MaponlineMap
    PortalItemportalItem

    See also Loadable and Cancelable.

    Property Documentation

    [read-only, since Esri::ArcGISRuntime 100.5] 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.


    [read-only, since 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.


    [read-only] 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.


    [read-only] createDefaultGenerateOfflineMapParametersStatus : Enums.TaskStatus

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


    [read-only, since Esri::ArcGISRuntime 100.4] 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.


    [read-only, since 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.


    [read-only] 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.


    [read-only] loadStatus : Enums.LoadStatus

    Returns the load status (read-only).

    See also Loadable and Enums.LoadStatus.


    [read-only] 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.


    [read-only] offlineMapCapabilitiesStatus : Enums.TaskStatus

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


    [default] onlineMap : Map

    The online map within this task.

    The online map will be of type Enums.PortalItemTypeWebMap, either on ArcGIS Online or an on-premise ArcGIS Enterprise Portal.


    [default] portalItem : PortalItem

    The portal item specifying the map to be taken offline.

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


    [read-only, since Esri.ArcGISRuntime 100.2] 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.


    [read-only, since Esri.ArcGISRuntime 100.2] preplannedMapAreasStatus : Enums.TaskStatus

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

    This property was introduced in Esri.ArcGISRuntime 100.2.


    Signal Documentation

    [since Esri.ArcGISRuntime 100.5] 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.


    [since Esri.ArcGISRuntime 100.4] 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.


    [since Esri.ArcGISRuntime 100.2] 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.


    [since Esri::ArcGISRuntime 100.5] 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 (0) 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).

    If the map being taken offline contains a UtilityNetwork and is in an ArcGIS Enterprise 11.1 or later service, the Offline Capability selected for the UtilityNetwork such as "Trace utility network features" will automatically be reflected in the default parameters created by this method. If the map being taken offline contains a UtilityNetwork and is in an earlier version of ArcGIS Enterprise, the GenerateGeodatabaseParameters::utilityNetworkSyncMode property is set to Enums.UtilityNetworkSyncModeSyncSystemTables for the Geodatabase containing the UtilityNetwork. Use createGenerateOfflineMapParameterOverrides(GenerateOfflineMapParameters) to change the Enums.UtilityNetworkSyncMode if desired.

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


    [since Esri::ArcGISRuntime 100.4] string createDefaultGenerateOfflineMapParametersWithScale(Geometry areaOfInterest, double minScale, double maxScale)

    Gets the default parameters for taking a map offline.

    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.


    [since Esri::ArcGISRuntime 100.4] string createGenerateOfflineMapParameterOverrides(GenerateOfflineMapParameters parameters)

    Returns a string of GenerateOfflineMapParameterOverrides created from the specified GenerateOfflineMapParameters 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 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 GenerateOfflineMapParameters::continueOnErrors 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 GenerateOfflineMapParameters::continueOnErrors is false, the returned string will complete containing an Error in the string::error property from the failed layer or table.

    To check upfront which layers or tables are valid for taking offline see offlineMapCapabilities(GenerateOfflineMapParameters).

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

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

    This method was introduced in Esri::ArcGISRuntime 100.4.


    [since 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)

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

    • parameters - GenerateOfflineMapParameters specify how to take a map offline. For example, specify the area of interest, min and max scale, layer attachment options.
    • downloadDirectoryPath - The path 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".

    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.


    [since Esri::ArcGISRuntime 100.4] 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.


    [since Esri.ArcGISRuntime 100.2] string preplannedMapAreas()

    Asynchronously retrieves 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.

    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.