Display a map from a mobile map package.
A mobile map package is an archive containing the data (specifically, basemaps and features) used to display an offline map.
When the sample opens, it will automatically display the map in the mobile map package. Pan and zoom to observe the data from the mobile map package.
- Create a
MobileMapPackage
specifying the path to the .mmpk file. - Load the mobile map package with
mmpk.loadAsync()
. - After it successfully loads, get the map from the .mmpk and add it to the map view:
mapView.setMap(mmpk.getMaps().get(0))
.
- MapView
- MobileMapPackage
- Download the data from ArcGIS Online.
- Open your command prompt and navigate to the folder where you extracted the contents of the data from step 1.
- Push the data into the scoped storage of the sample app:
adb push Yellowstone.mmpk /Android/data/com.esri.arcgisruntime.sample.openmobilemappackage/files/Yellowstone.mmpk
This sample shows points of interest within a Yellowstone Mobile Map Package hosted on ArcGIS Online.
mmpk, mobile map package, offline