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, or the full GeocodingParams (bar limit)
limit
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.
const place = await geocodeOne('Amsterdam Centraal');console.log(place.geometry.coordinates); // [lng, lat]const biased = await geocodeOne({ query: 'Main Street', geoBias: { position: [4.9041, 52.3676] }, signal }); Copy
const place = await geocodeOne('Amsterdam Centraal');console.log(place.geometry.coordinates); // [lng, lat]const biased = await geocodeOne({ query: 'Main Street', geoBias: { position: [4.9041, 52.3676] }, signal });
Geocode a query and return the single best-matching place.
Convenience wrapper around geocode that returns the top result directly.