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 = await MapView.Active.LocatorManager.AddLocatorAsync("D:\\Data\\Geocode\\ACT.loc"); //ArcGIS.Desktop.Mapping.Geocoding.LocatorProvider lp = await MapView.Active.LocatorManager.AddLocatorAsync(@"https://xyz/server/rest/services/yyy/GeocodeServer"); return true; }
internal async Task<bool> AddLocator() { ArcGIS.Desktop.Mapping.Geocoding.LocatorProvider lp = await
MapView.Active.LocatorManager.AddLocatorAsync("D:\\Data\\Geocode\\ACT.loc");
//ArcGIS.Desktop.Mapping.Geocoding.LocatorProvider lp = await MapView.Active.LocatorManager.AddLocatorAsync(@"https://xyz/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.
I get "Locator is not available on the current portal."
Hi Jamal,
Unfortunately, after further investigation, we've found that the LocatorManager class currently only supports local locators and locators shared to Portal. It does not support locator services.
Thank you for finding this issue. We will add support for locator services to the 2.5 version of the API.
Narelle
ArcGIS Pro 2.5 is out. I saw in the documentation it says this support was added. I upgraded to 2.5 as well as upgrading the sdk. This still does not work. Do you have any information on this? The behavior is the same as it was before. The locator name pops up with a red exclamation point.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.