MobileMapPackage

A mobile map package. 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 an .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 OfflineMapTask.generateOfflineMap(GenerateOfflineMapParameters, String) method to generate and download a mobile map package on-demand, or use the OfflineMapTask.createDownloadPreplannedOfflineMapJob(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 .vtpk) or an online basemap as the GeoModel.basemap

  • A mobile geodatabase (.geodatabase) or an online feature service as one of the GeoModel.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 Loadable 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 MobileMapPackage.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 MobileMapPackage.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.

Since

200.1.0

Constructors

Link copied to clipboard
constructor(path: String)

Create a MobileMapPackage with a path. The path can refer to a file with an .mmpk extension or a directory containing an unpacked mobile map package.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Expiration details for this mobile map package, if provided. Expiration details provide:

Link copied to clipboard
val item: Item?

The mobile map package's Item describing metadata about the package. The item includes the metadata about the mobile map package, such as:

Link copied to clipboard

A LocatorTask from the mobile map package. Use this task to geocode and reverse-geocode addresses and places. There is only one LocatorTask in each mobile map package but it can be used by all maps.

Link copied to clipboard

A collection of ArcGISMap from the MobileMapPackage. To use the maps in a MobileMapPackage, you first need to load the package. If the mobile map package was created with ArcGIS Pro, the maps are presented in the same order in which they were packaged. Mobile map packages created with the OfflineMapTask will only contain one map.

Link copied to clipboard

The path to the mobile map package. The path can refer to a file with an .mmpk extension or a directory containing an unpacked mobile map package.

Link copied to clipboard

The mobile map package's version. The mobile map package version is set when the package is authored in ArcGIS Pro or when it is generated by the OfflineMapTask.

Inherited properties

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

The load status.

Functions

Link copied to clipboard
fun close()

Closes a mobile map package. Closes a mobile map package and frees file locks on the underlying .mmpk file or directory.

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.