Geocoding with a locator service in the ArcGIS API for JavaScript
An ArcGIS Server locator service can perform both geocoding and reverse geocoding operations. Using the ArcGIS API for JavaScript, you submit an address to the Locator
task and have it return the geographic coordinates for any matched locations.
The following figure illustrates this process. An address, defined by a JSON object in JavaScript, is input as a parameter to the Locator
task object. The Locator
task geocodes the address and returns the results in an AddressCandidate
object which can then be displayed as a point on your map. This pattern is the same as the other tasks we've seen in previous chapters where an input object (Address
object) provides input parameters to the task (Locator
) which submits the job to ArcGIS Server. A result object (AddressCandidate
) is then returned to a callback
function for processing:
Input parameter object
The input parameter object for the Locator
task is either a JSON address object for...