Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/workers
Class: AddressCandidate

require(["esri/tasks/AddressCandidate"], function(AddressCandidate) { /* code goes here */ });

Description

(Added at v1.0)
Represents an address and its location. AddressCandidate has no constructor.

Samples

Search for samples that use this class.

Properties

NameTypeSummary
addressObjectAddress of the candidate.
attributesObjectName value pairs of field name and field value as defined in outFields in Locator.addressToLocations.
locationPointX- and y-coordinate of the candidate.
scoreNumberNumeric score between 0 and 100 for geocode candidates.
Property Details

<Object> address

Address of the candidate. It contains one property for each of the address fields defined by a geocode service. Each address field describes some part of the address information for the candidate.

<Object> attributes

Name value pairs of field name and field value as defined in outFields in Locator.addressToLocations.

<Point> location

X- and y-coordinate of the candidate.

<Number> score

Numeric score between 0 and 100 for geocode candidates. A candidate with a score of 100 means a perfect match, and 0 means no match.
Sample:
require([
  "dojo/_base/array", ... 
], function(array, ... ) {
  array.forEach(addressCandidates, function(candidate) {
    if (candidate.score > score && candidate.attributes.Loc_name === "US_RoofTop") {
      stop = candidate;
      score = candidate.score;
    }
  });
  ...
});