Show / Hide Table of Contents

Class MobileMapPackage

A mobile map package.

Inheritance
Object
MobileMapPackage
Implements
ILoadable
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: Esri.ArcGISRuntime.Mapping
Assembly: Esri.ArcGISRuntime.dll
Syntax
public sealed class MobileMapPackage : ILoadable
Remarks

Mobile map packages allow you to work with maps on a mobile device. A mobile map package contains all of the files necessary to work with your maps and is stored on a device as either:

  • A single archive file with a .mmpk extension.
  • A directory containing an unpacked mobile map package.

You can create a mobile map package using either:

  • ArcGIS Pro (from version 1.3). This API version supports any MobileMapPackage up to major version 5. Mobile map packages created with ArcGIS Pro are stored in a file with an .mmpk extension.
  • Use the GenerateOfflineMap(GenerateOfflineMapParameters, String) method to generate and download a mobile map package on-demand, or use DownloadPreplannedOfflineMap(DownloadPreplannedOfflineMapParameters, String) to download a mobile map package already prepared by the map author. Mobile map packages created with the OfflineMapTask are stored in a directory containing an unpacked mobile map package.

A mobile map package can encapsulate one or more maps along with their layers and data. Each package contains an Item with metadata about the package (description, thumbnail, etc.).

Mobile map packages created with ArcGIS Pro can also include transportation networks, locators, and links to online services. You can choose whether to use:

  • A tile package (such as .tpkx or .vptk) or an online basemap as the Basemap.
  • A mobile geodatabase (.geodatabase) or an online feature service as one of the OperationalLayers.

Online services (such as traffic or weather) can provide excellent contextual information for your users. If the mobile map package is going to be used in areas of poor connectivity, however, you must ensure that data critical to your workflow is stored locally on the device.

Mobile map packages implement the ILoadable interface; you need to load the MobileMapPackage before you can access its content. Once loaded you can:

  • Determine the version of this package using the Version property. This API currently supports mobile map packages up to and including major version 5. If the package is from an unsupported version, it will fail to load.
  • Discover whether the mobile map package has expired using the Expiration property.
  • Access the individual maps and display them in a MapView.
  • Programmatically add, modify, and remove layers in the map. Mobile map packages, however, are read-only and these changes to maps or layers are not persisted.

Constructors

Name Description
MobileMapPackage(String)

Initializes a new instance of the MobileMapPackage class.

Properties

Name Description
Expiration

Gets the expiration details for this mobile map package, if provided.

Item

Gets the mobile map package's Item describing metadata about the package.

LoadError

Gets the Exception associated with the last load error.

LoadStatus

Gets the load status.

LocatorTask

Gets the LocatorTask for the mobile map package.

Maps

Gets a collection of Maps from the MobileMapPackage.

Path

Gets the path to the mobile map package.

Version

Gets the mobile map package's version.

Methods

Name Description
CancelLoad()

Cancel loading metadata for the object.

Close()

Closes a mobile map package.

LoadAsync()

Load the metadata for the object asynchronously.

OpenAsync(String)

Opens a new instance of the MobileMapPackage class.

RetryLoadAsync()

Loads or retries loading metadata for the object asynchronously.

UnpackAsync(String, String)

Unpacks a mobile map package file (.mmpk) to an output directory.

UnpackAsync(String, String, CancellationToken)

Unpacks a mobile map package file (.mmpk) to an output directory.

Events

Name Description
Loaded

Event that is raised when the object is done loading.

LoadStatusChanged

Event that is raised when the LoadStatus property changes.

Applies to

TargetVersions
.NET Standard 2.0100.3 - 200.1
.NET 6.0100.13 - 200.1
.NET 6.0 Windows100.13 - 200.1
.NET 6.0 Android200.0 - 200.1
.NET 6.0 iOS200.0 - 200.1
.NET Framework100.0 - 200.1
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Android100.0 - 100.15
iOS100.0 - 100.15
UWP100.0 - 200.1

Relevant samples

Control annotation sublayer visibility: Use annotation sublayers to gain finer control of annotation layer subtypes.
Mobile map (search and route): Display maps and use locators to enable search and routing offline using a Mobile Map Package.
In This Article
Back to top Copyright © 2022 Esri.