Geocodes a query and returns the single best-matching place.
It wraps geocode and returns the top result directly.
The address or place name to geocode, or the full GeocodingParams without limit.
limit
The best-matching place.
With the code NOT_FOUND and the service 'Geocode' if no results are found for the query
NOT_FOUND
'Geocode'
To handle finding no results without throwing, use geocode with a limit parameter.
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 });
Geocodes a query and returns the single best-matching place.
It wraps geocode and returns the top result directly.