geocode(address: string | IGeocodeOptions): Promise<IGeocodeResponse>
Used to determine the location of a single address or point of interest. See the REST Documentation for more information.
Use dark colors for code blocks Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { geocode } from '@esri/arcgis-rest-geocoding';
geocode("LAX")
.then((response) => {
response.candidates[0].location; // => { x: -118.409, y: 33.943, spatialReference: ... }
});
geocode({
address: "1600 Pennsylvania Ave",
postal: "20500",
countryCode: "USA"
})
.then((response) => {
response.candidates[1].location; // => { x: -77.036533, y: 38.898719, spatialReference: ... }
});
Parameters Parameter Type Notes address
string | IGeocodeOptions
String representing the address or point of interest or RequestOptions to pass to the endpoint.
ReturnsÂPromise<IGeocodeResponse>
A Promise that will resolve with address candidates for the request. The spatial reference will be added to candidate locations and extents unless rawResponse: true
was passed.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4