Saturday, January 24, 2015

Dynamic Driving Directions with Turf

Turf is now available as a Mapbox.js plugin and can be used to perform many common GIS operations. Over the last few weeks the Mapbox blog has been posting a number of interesting examples of how Turf can be used with the Mapbox platform:

The posts on the Mapbox blog provide a number of useful use cases of how Turf can be deployed with Mapbox and provide some useful tips for anyone who is looking to develop a Mapbox based map using the Turf plug-in.

As the marker follows the driving route all the nearby electric vehicle charging stations are automatically added to the map using Turf's .distance() method. You can test how fast Turf can process data on the fly by dragging the start and end destination markers on the map to create a new route. Change the route and you can see how the nearby electric vehicle charging stations are updated instantly on the map.

As the animated marker follows a route you can also select any of the charging station markers on the map. The route is then automatically updated to take in a stop at the selected charging station.