Mobile Map Package
A mobile map package. Mobile map packages allow you to work offline with maps on a mobile device. Each mobile map package can encapsulate one or more map definitions, including their basemap layers, data layers, layer content, layer styles and pop-up definitions. Each mobile map package contains an Item with metadata about the package, such as the description and thumbnail.
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 single file with an .mmpk extension. Data contained in this mobile map package file cannot be edited. For more information, see the Create Mobile Map Package tool in ArcGIS Pro.
Use com.arcgismaps.tasks.offlinemaptask.OfflineMapTask.generateOfflineMap to generate and download a mobile map package on-demand, or use com.arcgismaps.tasks.offlinemaptask.OfflineMapTask.createDownloadPreplannedOfflineMapJob to download a mobile map package prepared as an offline map area by the map author (known as the ahead-of time workflow). Mobile map packages downloaded using the com.arcgismaps.tasks.offlinemaptask.OfflineMapTask are stored in a directory containing an unpacked mobile map package. You can edit feature data contained in this mobile map package and you can synchronize changes with their online feature services. For more information, explore the on-demand and ahead-of-time workflows offered by the com.arcgismaps.tasks.offlinemaptask.OfflineMapTask.
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 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.
MobileMapPackage implements the com.arcgismaps.Loadable interface. Once it is loaded, you can access its content and perform the following:
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 com.arcgismaps.mapping.view.MapView.
Programmatically add, remove, or modify layers by setting a display filter, changing the renderer, or changing the visibility on layers. These changes will not be persisted because mobile map packages are read-only.
Note: If the mobile map package was created with ArcGIS Pro, you cannot edit its underlying data from feature tables in a mobile map package. However, if you create a com.arcgismaps.data.FeatureCollectionTable based on the com.arcgismaps.data.FeatureQueryResult of a com.arcgismaps.mapping.layers.FeatureLayer in the mobile map package, you can edit the data in the com.arcgismaps.data.FeatureCollectionTable.
Since
200.1.0
Constructors
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.
Properties
Expiration details for this mobile map package, if provided. Expiration details provide:
A com.arcgismaps.tasks.geocode.LocatorTask from the mobile map package. Use this task to geocode and reverse-geocode addresses and places. There is only one com.arcgismaps.tasks.geocode.LocatorTask in each mobile map package but it can be used by all maps.
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 com.arcgismaps.tasks.offlinemaptask.OfflineMapTask will only contain one map.
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 com.arcgismaps.tasks.offlinemaptask.OfflineMapTask.