Turf is a JavaScript library which allows digital maps to implement many mutual GIS functions. Using Turf digital maps tin perform geospatial processing tasks amongst GeoJSON data. Turf connects to Leaflet, together with is also straightaway available every bit a Mapbox.js plugin.
You tin teach a nifty overview of the hit of Turf's geospatial processing capabilities on the Turf examples page. Using the library amongst Leaflet together with Mapbox is rattling easy. It took me less than fifteen minutes to set-up this map of central London law stations. I grabbed the GeoJSON information for the stations using Overpass Turbo together with hence merely used the html for the turf-nearest example inwards the Turf documentation.
The map shows the nearest London law station to a sure enough point. The queried place is pre-determined inwards this map but it should endure a uncomplicated chore to brand the marking of the queried place draggable. Turf tin procedure the geospatial question inwards the browser hence it should endure uncomplicated to allow users to question the map to discovery the nearest law station to whatever location.