Contents

reverseLookup(coordinate, options)

Converts a geographic coordinate to an address.

Declaration

reverseLookup(
    coordinate: Coordinate,
    options?: GeocoderReverseLookupOptions,
): Promise<GeocoderResponse>;

Parameters

  • coordinate:

    The coordinate to convert to a human-readable address. For example, new ``Coordinate```(37.779268, -122.419248)`, which represents San Francisco City Hall.

  • options:

    An option that constrains reverse lookup results to a specific language. See Geocoderreverselookupoptions.

Return Value

A promise that resolves with a GeocoderResponse on success, or rejects with an Error on failure.

Discussion

Reverse geocoding converts geographic coordinates to the nearest human-readable address.

The resolved GeocoderResponse contains an array of places named results. Each place in results has a coordinate property and a formattedAddress property. results is an empty array if there isn’t a match.

Pass an AbortSignal from an AbortController to the signal option to allow the controller to cancel a pending request. When the controller aborts, the promise it returns rejects with a DOMException whose name is "AbortError".

Topics

See Also

Getting geocoder results