You can use ArcGIS Pro to consolidate maps into a single mobile map package (.mmpk) that can be shared with your organizational account or copied directly to your mobile device. These read-only maps, their layers and associated data will be contained in a single mobile map package (.mmpk). This mobile map package adheres to a common map definition that allows you to transport your maps and data across the ArcGIS platform.
Create a mobile map package with ArcGIS Pro
You can create mobile map packages with ArcGIS Pro in the following ways:
- On the ArcGIS Pro Share tab, under Package, select New Mobile Map Package to create a mobile map package from the active map. For more information see share a mobile map package.
- Using the ArcGIS Pro tool called create a mobile map package from the Data Management Toolbox to create a mobile map package from one or more maps. With ArcGIS Pro 2.4 (or later) you can use this tool to set an expiration date on your mobile map package as long as ArcGIS Pro is licensed with the ArcGIS Publisher extension.
Note:If you'd like ready-to-use and regularly updated basemaps, locators, or network datasets for your area of interest, you can license StreetMap Premium data in mobile map package format. For details, see Add StreetMap Premium data.
Before you open and display maps provided by a mobile map package you should consider:
Unpack a mobile map package
With ArcGIS Pro version 2.1 (or higher) you can include raster datasets in a mobile map package. If this is the case then you must unpack the mobile map package file into a directory before you load it into your app. Here are the steps:
- Check if you can read the .mmpk file directly by examining the value of checkDirectReadSupportForMobileMapPackage.
- If you cannot read the .mmpk file directly then use the unpack method to place the contents of the .mmpk file into a directory.
- Instantiate the mobile map package using the directory location.
Unpacking a mobile map package file into a directory obviously occupies space. You may want to confirm that the device has sufficient space before you unpack the mobile map package file to avoid an unpacking error. To save space you could delete the original mobile map package file after unpacking completes (unless you need this file for another purpose).
Further advice regarding unpacking a mobile map package:
- If you try to load a mobile map package where direct read is not supported an error will be thrown. The error message will advise you to unpack the mobile map package file.
- Instead of adding raster data to a scene as an operational or basemap layer you could create a .tpk from raster data and add that to the map before creating the mobile map package. This would avoid the need to unpack the mobile map package.
- An unpackaged mobile map package takes roughly the same amount of space as the original file.
- You should confirm that the device has sufficient space before you unpack the mobile map package to avoid an unpacking error.
- You could delete the original mobile map package file after unpacking completes to save space (unless you need to retain this file for another purpose).
Mobile map package expiration
With ArcGIS Pro 2.4 (or later) you can set an expiration date on your mobile map package using some options provided by the ArcGIS Publisher extension. Expiration gives you more control over the lifetime of your data. For example, it will allow you to:
- Provide data to 3rd party contractors which will expire at the end of a contract.
- Indicate to your users that frequently changing data has become obsolete.
As an ArcGIS Runtime developer there are three possible outcomes when you try to load a mobile map package.
- You can access the mobile map package. This situation occurs if the mobile map package has not expired or if it has been created without an expiration.
- You can access the mobile map package even though the maps and their data have expired. You will be warned that the mobile map package is out of date.
- You cannot access the mobile map package because it has expired. In this case the mobile map package will fail to load and you will not be able to access its maps and data.
These three outcomes are managed by the mobile map package load process AGSMobileMapPackage.load. No extra workflow or code-paths are required to accommodate these.
You can, however, retrieve the expiration details from the expiration property on the AGSMobileMapPackage if you want to provide your users with extra information. For example, you could display how many days remain before the mobile map package expires:
- Load the mobile map package.
- Read the expiration property on the mobile map package.
- Confirm that the mobile map package has not expired.
- Get the expiry date.
- Calculate the number of days between today and the expiry date. Report the number of days remaining.
Access a map in a mobile map package
Once you have instantiated the mobile map package and confirmed that it is loaded you can access any of the maps within the package and pass them to the map view.