I am trying to load an mmpk file using LocatorTask in an ArcGIS Runtime SDK app but it fails after trying to load it for a few minutes. Any ideas why?
string path = System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), "California.mmpk"); _geocoder = new LocatorTask(new Uri(path)); _geocoder.LoadAsync()
Solved! Go to Solution.
The LocatorTask constructor is if you have locator, either online or local (.loc style as built in Desktop or Pro). In your case, the locator is in the MMPK, so you first need to open the map package to access the locator.
var mmpk = await MobileMapPackage.OpenAsync(path);
var locatorTask = mmpk.LocatorTask;
The LocatorTask constructor is if you have locator, either online or local (.loc style as built in Desktop or Pro). In your case, the locator is in the MMPK, so you first need to open the map package to access the locator.
var mmpk = await MobileMapPackage.OpenAsync(path);
var locatorTask = mmpk.LocatorTask;