Collection of places to enhance, returned in the same order
Configuration options, including common service parameters (e.g. apiKey, onAPIRequest, signal) forwarded to each availability request
OptionalexcludeIfAvailabilityUnknown?: booleanIf true, places with unknown availability are filtered out. Otherwise, they are returned unchanged.
OptionalmaxConcurrentRequests?: numberThe most availability requests in flight at once. Values below 1 count as 1.
Promise resolving to places collection with merged availability
One request per station, at most maxConcurrentRequests at a time — one by default, so a
large result set takes as many round trips in series. A failed request leaves its place with
unknown availability rather than failing the call.
Pass a signal to stop early: aborting it cancels the in-flight requests, skips the remaining
ones and rejects with SDKAbortError. Needs the same API key access as
evChargingStationsAvailability.
// Search for charging stations and add availability
const results = await discoverPlaces({
query: 'EV charging',
geoBias: { position: [4.9, 52.3], radiusMeters: 5000 }
});
const withAvailability = await getPlacesWithEVAvailability(results, {
excludeIfAvailabilityUnknown: true // Filter out stations with unknown availability
});
// Display only stations with known availability
withAvailability.features.forEach(place => {
const { count, statusCounts } = place.properties.chargingPark.availability.chargingPointAvailability;
console.log(`${place.properties.poi?.name}: ${statusCounts.Available ?? 0} of ${count} chargers available`);
});
Enhance multiple places with real-time EV charging availability data.
Fetches availability information for all EV charging stations in a collection and merges it into their properties. Non-EV places and EV stations without availability data are returned unchanged.
Collection of places to enhance, returned in the same order
Optionaloptions: PlacesWithEVAvailabilityOptions
Configuration options, including common service parameters (e.g. apiKey, onAPIRequest, signal) forwarded to each availability request
Promise resolving to places collection with merged availability
One request per station, at most maxConcurrentRequests at a time — one by default, so a
large result set takes as many round trips in series. A failed request leaves its place with
unknown availability rather than failing the call.
Pass a signal to stop early: aborting it cancels the in-flight requests, skips the remaining
ones and rejects with SDKAbortError. Needs the same API key access as
evChargingStationsAvailability.
// Search for charging stations and add availability
const results = await discoverPlaces({
query: 'EV charging',
geoBias: { position: [4.9, 52.3], radiusMeters: 5000 }
});
const withAvailability = await getPlacesWithEVAvailability(results, {
excludeIfAvailabilityUnknown: true // Filter out stations with unknown availability
});
// Display only stations with known availability
withAvailability.features.forEach(place => {
const { count, statusCounts } = place.properties.chargingPark.availability.chargingPointAvailability;
console.log(`${place.properties.poi?.name}: ${statusCounts.Available ?? 0} of ${count} chargers available`);
});
Enhance multiple places with real-time EV charging availability data.
Fetches availability information for all EV charging stations in a collection and merges it into their properties. Non-EV places and EV stations without availability data are returned unchanged.