TomTom Maps for JavaScript
    Preparing search index...

    Function getPlaceWithEVAvailability

    • Enhance a place with real-time EV charging availability data.

      Fetches availability information for an EV charging station and merges it into the place properties.

      Type Parameters

      Parameters

      • place: Place<P>

        The place to enhance with availability data

      Returns Promise<Place<EVChargingStationWithAvailabilityPlaceProps> | undefined>

      Promise resolving to the place with merged availability information

      // After search, enhance place with availability
      const searchResult = await search({ query: 'EV charging', ... });
      const place = searchResult.features[0];

      const enhancedPlace = await getPlaceWithEVAvailability(place);
      const availability = enhancedPlace.properties.chargingPark?.availability;

      if (availability) {
      console.log('Available chargers:', availability.chargingPointAvailability.count);
      }