Geocode a query and return the single best-matching place.
Convenience wrapper around geocode that returns the top result directly.
Address or place name to geocode
Promise resolving to the best-matching place
If no results are found for the query
Use geocode with a limit parameter when you need to handle the case where no results are found without throwing.
limit
const place = await geocodeOne('Amsterdam Centraal');console.log(place.geometry.coordinates); // [lng, lat] Copy
const place = await geocodeOne('Amsterdam Centraal');console.log(place.geometry.coordinates); // [lng, lat]
Geocode a query and return the single best-matching place.
Convenience wrapper around geocode that returns the top result directly.