reverseGeocode
FunctionreverseGeocode(coords: IPoint | ILocation | [void, void], requestOptions?: IEndpointOptions): Promise<IReverseGeocodeResponse>
Used to determine the address of a location.
import { reverseGeocode } from '@esri/arcgis-rest-geocoding';
//
reverseGeocode([-118.409,33.943 ]) // long, lat
.then((response) => {
response.address.PlaceName; // => "LA Airport"
});
// or
reverseGeocode({ long: -118.409, lat: 33.943 })
reverseGeocode({ latitude: 33.943, latitude: -118.409 })
reverseGeocode({ x: -118.409, y: 33.9425 }) // wgs84 is assumed
reverseGeocode({ x: -13181226, y: 4021085, spatialReference: { wkid: 3857 })
Parameters
Parameter | Type | Notes |
---|---|---|
coords | IPoint | ILocation | [void, void] | |
request | IEndpointOptions | Additional options for the request including authentication. |
Returns
Promise<IReverseGeocodeResponse>
A Promise that will resolve with the data from the response.