This is the documentation of version 1.0.0-rc.0. Go to the latest version, 1.0.0-rc.5.
TomTom Maps for JavaScript
    Preparing search index...

    Function geocodeOne

    • Geocodes a query and returns the single best-matching place.

      It wraps geocode and returns the top result directly.

      Parameters

      Returns Promise<Place<GeocodingProps>>

      The best-matching place.

      If no results are found for the query

      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 });