Hi,
I want to know how to add a locator from a server (ie a geocoding service).
The purpose is to give our users our own locators, when a project is opened.
Thanks in advance for your reply.
You can have this functionality by adding the geocoding services as Utility Services in ArcGIS Enterprise. This must be done by the administrator but once it is done, all users will see these locators loaded by default when signed in. More about this can be found here:
Configure utility services—Portal for ArcGIS (10.6) | ArcGIS Enterprise
Brad
Is there any other way to do this outside of Portal?
Take a look at the LocatorManager class available from the active map view. It allows you to add locators
https://pro.arcgis.com/en/pro-app/sdk/api-reference/index.html#topic18887.html
Here's an example snippet
internal async Task<bool> AddLocator()
{
ArcGIS.Desktop.Mapping.Geocoding.LocatorProvider lp = awaitMapView.Active.LocatorManager.AddLocatorAsync("D:\\Data\\Geocode\\ACT.loc");
//ArcGIS.Desktop.Mapping.Geocoding.LocatorProvider lp = await MapView.Active.LocatorManager.AddLocatorAsync(@"https://xxx/server/rest/services/yyy/GeocodeServer");
return true;
}
I have tried to do this. I am attempting to use a locator service. When I add it to the project I can see it added but it is greyed out and unusable. The only thing I can do with it is remove it.
Do you have any suggestions or ideas as to why this maybe. I'm not getting any errors anywhere.
Jamal,
What type of locator are you adding to Pro? Can you do it via Pro without error? When you open the Locate Pane, click on the settings tab and hover over the locator does it give you any type of warning or error?
Brad
This is a Locator Service published to ArcServer 10.6.1. Yes I can add it to the project and LOcators manually. I can aadd it both direct from server connection and a server connection file.
Jamal,
What path is showing in Pro when you hover over the locator in the Locators folder in the Catalog Pane? Are you using the same path when you are adding it via the SDK?
For instance, when I add a locator via the Server connection:
I see a path like this:
C:\path\arcgis on servermachine_6080\name_of_locator.GeocodeServer
Is this how you are entering the path?
Brad
Yes only no 6080, we are using a webAdaptor. That is the syntax being used. C:\{path}\arcgis on {serverpath}\Locators(Folder)\{LocatorName}.GeocodeServer. I verified the path and connection work by adding it manually(using Add Locator) in ArcGIS pro.