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

    Function discoverOnePlace

    • Searches for a single place by text query.

      It calls discoverPlaces and returns the first result. It throws an error if no results are found.

      Parameters

      Returns Promise<Place<SearchPlaceProps>>

      The first matching place.

      If no results are found for the query

      const place = await discoverOnePlace('Vondelpark Amsterdam');
      console.log(place.properties.poi?.name);

      const nearby = await discoverOnePlace({ query: 'coffee', geoBias: { position: [4.9041, 52.3676] }, signal });

      Use it to quickly find a single place, particularly a POI. To find a single address, consider 'geocodeOne'.