reverseLookup(coordinate, callback, options)
Converts a geographic coordinate to an address.
Declaration
reverseLookup(
coordinate: CoordinateData,
callback: (
error: Error | null,
result: GeocoderResponse | null,
) => void,
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. - callback:
MapKit JS invokes this callback function with two arguments,
erroron failure anddataon success. If you cancel the request before you receive a response, the framework doesn’t call this function.error(Error). Contains an error code and descriptive message.data(Geocoderresponse). An object that contains an array of places named Results.
- options:
Language is the only option that you can set for the reverse geocoder. For example,
{ language: 'fr-CA' }tells the server to send results localized to Canadian French. If you set it, this option overrides the language you provide in the Geocoder constructor.
Return Value
A promise that resolves with a GeocoderResponse on success.
Discussion
Reverse geocoding converts geographic coordinates to the nearest human-readable address.