Skip to main content
Reverse Search takes a latitude/longitude pair and returns the nearest named place. The usual pattern is a long-press on the map — “what is here?”.

The request

number
required
Latitude of the point to look up.
number
required
Longitude of the point to look up.
number
Search radius in kilometres. Widen it for rural areas where features are sparse.
integer
Maximum number of results to return.

Wiring it to a long-press

Note the destructuring above: event.geometry.coordinates is [lon, lat], but reverseGeocode takes (latitude, longitude). Getting this backwards returns a plausible address for entirely the wrong place rather than an error. See coordinate order.

Handling empty results

Reverse search returns an empty data array when nothing is near enough — over water, or in an unmapped area. Handle it explicitly instead of reading data[0] blindly:

Next

Directions

Route between the points you have picked.

Reverse Search API

Full parameter reference and playground.