TomTom Maps for JavaScript
    Preparing search index...

    Function geocodeOne

    • Geocode a query and return the single best-matching place.

      Convenience wrapper around geocode that returns the top result directly.

      Parameters

      • query: string

        Address or place name to geocode

      Returns Promise<Place<GeocodingProps>>

      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]