Partilhar via


How to download and update offline maps (XAML)

Call the methods of the MapManager class to let the user download maps for offline use, or to update offline maps that the user downloaded previously.

The MapManager class belongs to the Windows.Services.Maps namespace. The class has the following two methods.

The MapManager class is a static class, so you can call its methods without creating an instance of the class. These methods are not asynchronous. They do not return data or status information to your app.

Important  The methods described in this topic take the user to another app. The user has to go back to your app manually after downloading or updating maps.

 

Before you call the methods of the MapManager class

At the top of your class file, add a using statement for the Windows.Services.Maps namespace.

using Windows.Services.Maps;

Letting the user download maps for offline use

To let the user download maps for offline use, call the ShowDownloadedMapsUI method. This method replaces the MapDownloaderTask.

    MapManager.ShowDownloadedMapsUI();

This method call displays the following page:

Updating offline maps that the user downloaded previously

To update offline maps that the user downloaded previously, call the ShowMapsUpdateUI method.

    MapManager.ShowMapsUpdateUI();

This method call displays the following page:

How to display maps and directions in the built-in Maps app