I created a POI locator using ArcGIS Pro. I have a wpf app and i want to use the created locator in that app.
I am trying to load it using the following code snippet.
string streetMapOSMPath = AppDomain.CurrentDomain.BaseDirectory + "MapTest20200328_2.mmpk";
string testmmpkPath = AppDomain.CurrentDomain.BaseDirectory + "test20230530.mmpk";
string locatorPath = AppDomain.CurrentDomain.BaseDirectory + "GIS_test_20230_POI_Locator.loc";
Uri _serviceUri = new Uri(locatorPath);
try
{
// Load the package
MobileMapPackage streetMapOSMPackage = await MobileMapPackage.OpenAsync(streetMapOSMPath);
MobileMapPackage testMapOSMPackage = await MobileMapPackage.OpenAsync(testmmpkPath);
// Load Geocoder
//_geocoder = testMapOSMPackage.LocatorTask;
_geocoder = await LocatorTask.CreateAsync(_serviceUri);
}
catch (Exception ex)
{
// Handle any exception
System.Windows.MessageBox.Show(ex.Message, "Error opening package");
return;
}
I tried mmpk and .loc approaches with no success. i get LoadStatus: FailedToLoad.
Geocoder creation error: file too small to contain valid file header"
Any ideas?