The code can be viewed at
Following are the lines to add a polyline
L.polyline([[31.233, 121.465], [31.233499, 121.500634], [31.190172, 121.588107]], {
color: '#000',
smoothFactor: 10.0
}).addTo(map)
As can be seen, there is an angle in the joint point of every two lines belonging to the polyline, like this, which is not so attractive:
I was wondering whether there is an easy way to make the angle into a rounded curve in Mapbox..
(I saw this post about smoothing a polyline Smooth polyline with minimal deformation . In that post, I saw CHAIKIN'S ALGORITHMS is suggested but the drawback of that algorithm is that the smoothed curve doesn't pass directly through the control points... )
You should get a string geometry that can be converted to an array of coordinates
}
You can use turf-bezier to create an interpolated bezier line out of any LineString geometry.