TomTom Maps for JavaScript
    Preparing search index...

    Function searchOne

    • Search for a single place by text query.

      Convenience function that calls search and returns the first result.

      Parameters

      • query: string

        Search query string

      Returns Promise<Place<SearchPlaceProps> | undefined>

      Promise resolving to the first matching place, or undefined if no results

      const place = await searchOne('Vondelpark Amsterdam');
      if (place) {
      console.log(place.properties.name);
      }
      • Useful to quickly find a single place, particularly a POI.
      • If you want to find a single address, consider 'geocodeOne'.