Select to view content in your preferred language

LocatorTask failed to load mmpk file

956
1
Jump to solution
10-11-2019 10:03 AM
SOTIRIOSTRIANTOS1
New Contributor

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()
0 Kudos
1 Solution

Accepted Solutions
ChadYoder1
Frequent Contributor

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;

View solution in original post

0 Kudos
1 Reply
ChadYoder1
Frequent Contributor

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;

0 Kudos