How to convert polyline with weight to polygon in Leaflet?

Viewed 4088

I need to allow user to draw a route (using polyline) with specified road radius (visually it was done with "weight" parameter).

Visually it looks like that:

enter image description here

So I'm wondering how can build a polygon around this polyline with some offset? Like this:

enter image description here

2 Answers
Related