Display a map from a mobile map package.
Use case
An .mmpk file is an archive containing the data (specifically, basemaps and features) used to display an offline map.
How to use the sample
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.
How it works
- 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.Map = package.Maps.First();
.
Relevant API
- MapView
- MobileMapPackage
About the data
This sample shows points of interest within a Yellowstone Mobile Map Package hosted on ArcGIS Online.
Tags
mmpk, mobile map package, offline
Sample Code
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="ArcGISRuntime.Samples.OpenMobileMap.OpenMobileMap"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms">
<esriUI:MapView x:Name="MyMapView" />
</ContentPage>