All tutorials
How to add the what3words Locator to Experience Builder for ArcGIS
This tutorial will take you through the steps required to add the what3words ArcGIS Locator to a custom widget built using ArcGIS Experience Builder. This widget will help you to perform reverse geocoding (convert a point to a what3words address) on your ArcGIS Online or Portal for ArcGIS.
Further information on the features of the Locator can be found here.
Setting up the locator in ArcGIS Online takes a few minutes. Once set up, it will be available across the ArcGIS Online suite.
Resources: The what3words ArcGIS Experience Builder widget is available in our
GitHub repository
- An installed and configured instance of ArcGIS Experience Builder (Developer Edition);
- A URL of your what3words ArcGIS Locator that has been added to your ArcGIS Online or your Portal for ArcGIS by following this instruction on the what3words developer site;
- A copy of this widget
what3words
. - Install
axios
via npm packages in the root directory of your project:
npm install axios
- Deploy the widget by copying the
what3words
folder and its contents into your ArcGIS Experience Builder installation’sclient/your-extensions/widgets/
folder and restart your watcher; - Run both ArcGIS Experience Builder server and ArcGIS Experience Builder client in 2 separate terminals;
- Create your Experience Application;
- Create your experience application with a base map. You can now add the what3words widget to the map, on the side, or whichever you prefer. You can search the
what3words
widget by typing its name on the search bar at the top of the list of widgets or looking for the widget on the list.
Once you have found it you can drag and drop the widget onto your application whichever you prefer, next to map, on top of it or at the bottom of it. On the widget, you can display the what3words address, the coordinates in WGS84, the copy and mapsite buttons, and the map annotation of the address. On the Content panel of the widget on the right-hand side, you have 3 sections:
1. Select a map that you want your widget to work on;
2. Select your Mode Selection by using the: what3words API key
or what3words Locator URL
If you choose the API key, you need to enter your what3words API key. Click Save
and then choose your what3words language
.
If you choose the locator URL, you can Select Utility
. Search among your locators on your ArcGIS Online account and pick the one you want to use.
3. Display some widget options:
- The Latitude & Longitude coordinates options allow you to display the WGS84 coordinates of the related what3words address;
- The Copy button allows you to copy the what3words to your clipboard;
- The Mapsite button allows you to open the what3words address to the mapsite www.what3words.com;
- The Map Annotation allows you to display the label of the what3words address next to the marker;
- The Nearest Place Text is only available if you choose the API mode and display the nearest places for that what3words address.
Configure the widget with your what3words Locator URL
. By using the what3words locator, you would be able to retrieve the correct what3words address in any coordinate systems used on your web map. Example of a what3words Locator: https://utility.arcgis.com/usrsvcs/servers/<MyGeocodingArcGISUniqueID>/rest/services/what3words_EN_English/GeocodeServer
.
To find the what3words Locator URL, go to your ArcGIS Online or Portal for ArcGIS, and click on the Content > My Organization
tab. Search for your locator, you could filter by Item type > Tools > Locators
as shown on this screenshot.
Then click on your Locator, scroll down to the bottom of the page, and on the right-hand side, you will find the URL of your Locator. You need to copy and paste this URL to the configuration page of the what3words widget, as shown in this screenshot.
The widget is now ready to run inside your Experience Builder app. Click on the map to retrieve the what3words address at the clicked location. For example, the point selected on the map returned this what3words address: ///filled.count.soap
.
If after installing correctly the what3words locator across your ArcGIS platform, you cannot display your what3words locator on your Experience app, it could be that your what3words locator hasn’t been put at the top of your Geocoding services
.
To resolve this issue, please drag and drop the what3words locator at the top of the Geocoding service list, as it is shown in this screenshot. You can find this list under your Organisation > Utility services > Geocoding section
.