Open mobile map package

View inMAUIUWPWPFWinUIView on GitHub

Display a map from a mobile map package.

Image of open 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

  1. Create a MobileMapPackage specifying the path to the .mmpk file.
  2. Load the mobile map package with mmpk.LoadAsync().
  3. 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

OpenMobileMap.xamlOpenMobileMap.xamlOpenMobileMap.xaml.cs
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
<UserControl
    x:Class="ArcGIS.UWP.Samples.OpenMobileMap.OpenMobileMap"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls" >
    <esriUI:MapView x:Name="MyMapView" />
</UserControl>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.