Summary
The Locator
task allows you to interact with an ArcGIS Server locator service to perform geocoding and reverse geocoding operations. It does this using the addressToLocation()
and locationToAddress()
methods. The first expects a JSON object that specifies the address to search for, and the second expects both a Point
location around which to search and a numerical distance.
When you execute the appropriate method for the type of geocoding operation you require, the results are returned in AddressCandidate
objects which you can process and plot the results.
This workflow should now seem quite familiar to you, as it is very similar to the other tasks you have used in the ArcGIS API for JavaScript.
In this chapter, we learned how to identify locations. In the next chapter, we'll be able to tell users how to reach those locations by using the API's direction and routing capabilities.