I am working on a map with Mapbox and Leaflet and I am supposed to let the user draw polygons and calculate and show the are of that polygon and I also need to let the user draw
I would also encourage readers to check out the turf library. It works great with leaflet and has many useful methods including polyline distance. http://turfjs.org/docs