I'm using ArcGIS Runtime for .NET with WPF UI framework, version 100.13.0 and I am trying to re-use the map files downloaded with code from this tutorial: Display an offline map (on-demand). After looking through the downloaded files I found the .mmap file which, I assume, is a Mobile Map file. Does this have anything to do with mobile map packages? Is my app destined to re-download the AOI for offline use on each launch?
When you download an offline map using the OfflineMapTask, Runtime will create a folder at the location you specify when you create the new GenerateOfflineMapJob, and will download and write a number of resources into that folder. As you noticed, there is a .mmap file, but you should consider the folder to be a black box.
To re-use the already downloaded offline map, as @JoeHershman shows below, you create a new MobileMapPackage with the same folder you specified when you downloaded the offline map. Then get the first map from it. See this documentation for more info.
Note, you do not need to explicitly load the map or its operational layers unless you plan on reading their metadata before they are displayed in a map view.
You can either download a new copy of the map, or open what exists on the device. If you open the offline map it would not download a new version, you have to explicitly download
MobileMapPackage localMapArea = await MobileMapPackage.OpenAsync(mapPackagePath); //assuming a single map in map package var map = localMapArea.Maps.First(); await map.LoadAsync(); //This just makes sure all the FeatureLayers are loaded map.OperationalLayers.ToList().ForEach(async l => await l.LoadAsync());
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.