The geocoding process
Let's summarize the process for geocoding an address with the ArcGIS API for JavaScript.
First, you create a Locator
task object by referencing the URL of a locator task running on an ArcGIS Server instance. You then create the input address as a JSON object and submit it to the Locator
task using the addressToLocations()
method. When the operation completes, it returns an array of AddressCandidate
objects which you can then plot on the map. It's up to you to decide which element in the array to use. Normally, it's the one with the best score:
Note
Note that, for batch geocoding operations, you can use the addressesToLocations()
method, which allows you to specify multiple input addresses.