Skip To Content ArcGIS for Developers Sign In Dashboard


You will learn: how to build an app that loads a basemap and feature layers from a mobile map package file.

ArcGIS Runtime SDK for .NET allows you to provide offline maps to your users so they can be productive when their network connectivity is poor or offline. The mobile map package is a .mmpk file created with ArcGIS Pro, and loaded to your user's device.

In this tutorial you will learn how to load a mobile map package and then use it in your app.

Prepare your data

Complete the tutorial Prepare your data for offline use. You will use the map package file created in that tutorial for the offline map data required in this tutorial.


Create a new ArcGIS Runtime App Visual Studio Project

  1. Start Visual Studio.

  2. Choose File > New > Project and select the ArcGIS Runtime App template for your chosen platform.

Load your mobile map package on to your device

  1. You created a mobile map package in the tutorial Prepare your data for offline use. Load that file on to your device. If you did not complete that tutorial, download the mobile map package we prepared.

Load and display the mobile map package

  1. Open the MapViewModel.cs code file in your project. Find the definition for the Map property in the class. Notice that the default map is currently set to display the streets raster tile basemap. You are going to load the map from a file so this assignment is not needed. Set the _map variable to null.

    private Map _map = null;
  2. Add a new method to load the mmpk file into a Map object and then update your MapViewModel to display it.

     async private void SetupMobileMap()
         Boolean isMapLoaded = false;
         var mapPackageFolder = @"..\..\..\";
         var mapPackageFile = @"offline-maps-package.mmpk";
         var mapPackagePath = System.IO.Path.Combine(mapPackageFolder, mapPackageFile);
             var mapPackage = await MobileMapPackage.OpenAsync(mapPackagePath);
             if (mapPackage != null && mapPackage.Maps.Count > 0)
                 Map = mapPackage.Maps[0];
                 await Map.LoadAsync();
                 if (Map.LoadStatus != Esri.ArcGISRuntime.LoadStatus.FailedToLoad)
                     isMapLoaded = true;
         catch (System.IO.FileNotFoundException ex)
         if ( !isMapLoaded)
             Map = new Map(Basemap.CreateStreetsVector());
  3. Update the MapViewModel constructor to call the new method.

     public MapViewModel()

Congratulations, you're done!

Your map, as it was designed in ArcGIS Pro, should load and display with the view point centered on the Los Angeles area. If the map was not loaded successfully from the package, you will see the vector streets base map displayed at a global scale.


Change map contents

Learn how you can change many elements of your map without writing any code. Return to ArcGIS Pro and alter your map: change the extent, add or remove layers, change symbology. Republish your mobile map package and load it on your device.

File selection

Add a UI to allow your user to pick the mmpk file instead of hard-coding it in your code.