I use the following code to draw a GPS track with Leaflet:
const trackJson: L.GeoJSON = L.geoJSON(trackAsJson, {
style: {
color: '#ff0000',
weight: 30,
opacity: 1
}
});
I'd like now calculate the area that is covered by this track, drawn with the specified weight/width. However, I can't find any way to achieve that. All methods that I could find require to have some form of a shape and not just only a line. So I'm either looking for a way to:
- Turn the path and the specified weight into a shape or
- Find a direct method to calculate the area of a path and a weight.