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

    Function getPlaceDetails

    • Retrieves detailed information about a place using its unique identifier.

      The place details service fetches comprehensive data for a specific place when you have its ID from a previous search. Use it to get additional details or refresh information about a known location.

      Parameters

      Returns Promise<PlaceDetailsResponse>

      The detailed place information, or undefined when the ID matches nothing.

      Use it to fetch a POI's opening hours, related POIs and EV charging hardware, update the information of a cached place, let users share or bookmark specific places through deep links, or explore parent/child relationships between related POIs.

      You can get the ID from:

      • Previous search results (place.id, on the feature rather than in its properties)
      • Related POIs (place.properties.relatedPois[].id)
      • Deep links or bookmarks
      // Get a search result's full details
      const searchResult = await discoverPlaces({ query: 'Eiffel Tower' });
      const place = searchResult.features[0];

      const placeDetails = await getPlaceDetails({
      entityId: place.id,
      openingHours: 'nextSevenDays'
      });

      // Navigate to related POI
      const relatedPOI = place.properties.relatedPois?.[0];
      if (relatedPOI) {
      const parentPlace = await getPlaceDetails({
      entityId: relatedPOI.id
      });
      if (parentPlace) console.log('Parent location:', parentPlace.properties.address);
      }