Query station details
To query the details of astation, a station
id is required. This can be passed into the
station query. From there, amenities, predicted availability and other details can be used.
View on Github
- Chargetrip API key - to fetch stations all over Europe instead of a subset
- Mapbox API key - to display the map
- URQL - a lightweight graphQL client
- Just like the previous example, the
stationAroundquery is used to display stations around a GeoJSON location.
- With stations available on the map, click interactions can be added.
- A click handler on the station icon will initiate the
stationquery. This example will request the chargers, amenities, predicted availability and operator details. More fields are available within the API reference.
- After receiving the data, it will be rendered on the screen.
After stations are available on a map, fetching additional station data on interaction is a logical next step. So let's move onto the next example to fetch data such as chargers, predicted availability, amenities or operator details.