Hello i wonder if the runtime supports to load .mmpk file , i have .mmpk with (a map and operational Layer) when i tired to load the (.mmpk) with local map server it fails and i have the following exception
Esri.ArcGISRuntime.Http.ArcGISWebexception
{"Failed to create service symbolswithbasemap MapServer. Service failed to initialize: IObjectConstruct::Construct (MapServer) hr=0x80043000 (ErrorInfo did not include a description)"}
private async void StartupLocalServer()
{
// Createa local map service from a map package on disk
var mapService = new LocalMapService(@"C:\Users\mkeddar\Desktop\mappackage\SymbolsWithBasemap.mmpk");
//get the service URL
var mapServiceUrl = mapService.Url;
await mapService.StartAsync();
//create a new ArcGISMAPImageLayer
Esri.ArcGISRuntime.Mapping.ArcGISMapImageLayer localServiceLayer = new Esri.ArcGISRuntime.Mapping.ArcGISMapImageLayer(mapServiceUrl);
await localServiceLayer.LoadAsync();
//dd the layer to the map
MyMapView.Map = new Esri.ArcGISRuntime.Mapping.Map();
MyMapView.Map.OperationalLayers.Add(localServiceLayer);
}
I've shared my .MMPK and my Map please tell me if it's supported cause when i checked local server support package i didn't see (.mmpk) files and even (.slpk) Local Server package support—ArcGIS Runtime SDK for .NET (WPF) | ArcGIS for Developers
thanks
To open an mmpk use MobileMapPackage.OpenAsync(string path)
Please can you give me the full program ? i didn't find on the Guide any thing about (.mmpk) , do i have to featureLayers with it or ArcgisMapImageLayer() ? need more explanation about it
Thanks
Below are some resources for you:
Mobile Map Packages: Mobile map package—ArcGIS Pro | ArcGIS Desktop
Using offline map in Runtime SDK for .NET: Offline—ArcGIS Runtime SDK for .NET (WPF) | ArcGIS for Developers
Sample code to open an MMPK: arcgis-runtime-samples-dotnet/OpenMobileMap.xaml.cs at ba801b4e9593b52aaf1b8f713f5ae878a23e2077 · Es...
WPF example app that uses mobile map packages: Home · Esri/mapbook-wpf Wiki · GitHub