Display an isoline to show driving distance
Is the destination reachable with the current state of charge? Can an electric vehicle really go that far? Questions often heard. By using isolines, these questions don't go unanswered. Display the driving distance from a location on a map.
View on Github
- Chargetrip API key - to plot routes outside this region
- Mapbox API key - to display the map
- URQL - a lightweight graphQL client
- To display an isoline, a mutation and subscription are required. The
createIsolinemutation will be used to define variables such as the
polygon_countand location. In return an
idwill be created that can be used on the subscription.
- The isoline subscription will provide status updates. Calculation of an isoline can take a little while depending on the
- When the isoline is ready and the subscription returns status
done, it can be plotted on the map.
This example illustrates the basics of how to display an isoline. To learn more about isolines and their capabilities navigate to our API reference.