A geocoder (service that can lookup features by address).

Type Parameters

Hierarchy (view full)

Constructors

Properties

_capabilitiesInternal: GeocoderCapabilities = ...

The default capabilities for a geocoder.

_handles: Handles<unknown, ResourceHandle>
_id: string

The unique ID for this entity. Once set, this should never change.

_itemType: string = ItemType.GEOCODER

The item type for this entity when it participates in an App.

Do not directly reference this property. Use EventNames and EventTypes helpers from @arcgis/core/Evented.

addressSchema: Schema

The schema that defines the input address fields.

defaultAddressValues: Map<string, unknown>

Default address field values to use when they are missing in the input address. For instance, if a geocoder has a "City" input field, then setting its default value to "Victoria" would cause the geocoder to search for addresses within the city of Victoria by default if no city is specified.

iconUrl?: string

URL to an icon that represents this feature source.

onAddFeature?: Action

The action to be executed when a feature is added.

onEditFeature?: Action

The action to be executed when a feature is edited.

queryService?: QueryService

An optional query service that the feature source can use to get features.

title: string

Accessors

  • get featureSettings(): FeatureSettings
  • Default settings that apply to features originating from this source.

    Returns FeatureSettings

  • Hyperlinks associated with the feature source.

    Returns Collection<Hyperlink>

  • get id(): string
  • The unique ID for this entity.

    Returns string

  • get itemType(): string
  • The item type for this entity when it participates in an App.

    Returns string

  • get relationships(): Collection<Relationship>
  • Relationships to other feature sources.

    Returns Collection<Relationship>

  • get schema(): Schema
  • Metadata about features originating from this source, such as fields, domains, and geometry type.

    Returns Schema

  • get taskSettings(): TaskSettings
  • Settings that affect whether a feature source participates in various tasks that are performed on a map.

    Returns TaskSettings

Methods

  • Called to add new features. Subclasses must override this if they support adding features.

    Parameters

    • features: Iterable<Feature, any, any>

      The features to add.

    • Optionaloptions: FeatureWriteOptions

      Additional options that control how the feature is saved.

    Returns Promise<void>

  • Called to remove attachments from a feature. Subclasses must override this if they support feature attachments.

    Parameters

    • feature: Feature

      The feature to delete attachments from.

    • attachments: (string | Attachment)[]

      The attachments or the IDs of the attachments to delete.

    Returns Promise<void>

  • Called to delete features. Subclasses must override this if they support deleting features.

    Parameters

    • ids: string[]

      The IDs of the features to delete.

    • Optionaloptions: FeatureWriteOptions

      Additional options that control how the features are deleted.

    Returns Promise<void>

  • Called to retrieve attachments for a feature. Subclasses must override this if they support feature attachments.

    Parameters

    • feature: Feature

      The feature to get attachments for.

    Returns Promise<Attachment[]>

  • Called to retrieve features. Subclasses must override this if they support querying for features.

    Parameters

    • ids: string[]

      The unique IDs of features to retrieve.

    • Optionaloptions: FeatureReadOptions

      Options that control what gets returned.

    Returns AsyncIterable<Feature, any, any>

  • Called to perform cleanup. Subclasses should override this method rather than destroy() to perform custom cleanup.

    Returns Promise<void>

  • Called after normal initialization. Note: Child items are initialized before this is called.

    Returns Promise<void>

  • Called to update features. Subclasses must override this if they support updating features.

    Parameters

    • features: Iterable<Feature, any, any>

      The feature to update.

    • Optionaloptions: FeatureWriteOptions

      Additional options that control how the feature is saved.

    Returns Promise<void>

  • Finds locations corresponding to multiple addresses. The geocoder must have the supportsBatchGeocoding capability (see capabilities).

    Parameters

    • addresses: AddressLike[]

      The addresses to search for. Can either be a string like "123 Sesame Street", or a feature or JSON object representing an address. In the latter case, the address field names and types understood by the geocoder are defined by the addressSchema property. Only the attributes are used -- any geometries on input features are ignored.

    • Optionaloptions: GeocodeOptions

      Options that affect how the search is performed.

    Returns AsyncIterable<Feature, any, any>

    A set of features representing a candidate matches for each address. In addition to its normal attributes, each feature will have a special data/Feature!SCORE_FIELD attribute which is a number from 0 to 100 indicating a level of confidence in the match. It will also have a special tasks/geocoding/Geocoder!ADDRESS_FIELD attribute which is the input address that it matches.

  • Counts the number of locations corresponding to an address.

    Parameters

    • address: AddressLike

      The address to search for. Can either be a string like "123 Sesame Street", or a feature or JSON object representing an address. In the latter case, the address field names and types understood by the geocoder are defined by the addressSchema property. Only the attributes are used -- any geometry on the input feature is ignored.

    • Optionaloptions: GeocodeOptions

      Options that affect how the search is performed.

    Returns Promise<CountResult>

    A count resulting indicating the number of candidate matches for the address.

  • Deletes attachments from a feature.

    Parameters

    • feature: Feature

      The feature to delete attachments from.

    • attachments: (string | Attachment)[]

      The attachments or the IDs of the attachments to delete from the feature.

    Returns Promise<void>

  • A clean-up function that should get called whenever the item is disposed of.

    Returns Promise<void>

  • Finds one or more locations corresponding to an address.

    Parameters

    • address: AddressLike

      The address to search for. Can either be a string like "123 Sesame Street", or a feature or JSON object representing an address. In the latter case, the address field names and types understood by the geocoder are defined by the addressSchema property. Only the attributes are used -- any geometry on the input feature is ignored.

    • Optionaloptions: GeocodeOptions

      Options that affect how the search is performed.

    Returns AsyncIterable<Feature, any, any>

    A set of features representing candidate matches for the address. In addition to its normal attributes, each feature will have a special data/Feature!SCORE_FIELD attribute which is a number from 0 to 100 indicating a level of confidence in the match.

  • Gets a feature by ID. If no such feature exists, the promise is rejected with an instance of NotFoundError.

    Parameters

    • id: string

      The ID of the feature to retrieve.

    • Optionaloptions: FeatureReadOptions

      Additional options that control how the feature is retrieved.

    Returns Promise<Feature>

  • Gets a set of features by their IDs.

    Parameters

    • ids: string[]

      The IDs of the features to retrieve.

    • Optionaloptions: FeatureReadOptions

      Additional Options that control how the features are retrieved.

    Returns AsyncIterable<Feature, any, any>

  • Returns the full extent of the source that contains all included features.

    Returns Extent

  • Finds the address at a particular location. The geocoder must have the supportsReverseGeocoding capability (see capabilities).

    Parameters

    • location: Point

      The location to search for.

    • Optionaloptions: GeocodeOptions

      Options that affect how the search is performed.

    Returns Promise<Feature>

    A feature representing the address at the given location, or undefined if there is no match.

  • Suggests matching addresses to search for based on some input text. The geocoder must have the supportsSuggest capability (see capabilities).

    Parameters

    • searchText: string

      The input text to search for.

    • Optionaloptions: GeocodeOptions

      Options that affect how the search is performed.

    Returns Promise<string[]>

    A list of formatted address suggestions.