ProminentEdge / leaflet-measure-path

Show measurements on Leaflet paths
Other
98 stars 25 forks source link

No support for nested polygons (aka multipolygons) #8

Open asavartsov opened 7 years ago

asavartsov commented 7 years ago

It would be great to support distances and area on multipolygons and multipolylines, they have just another array depth in latlng arrays (http://leafletjs.com/reference-1.0.0.html#polygon).

I did a quick fix for my project but you probably could do better.

https://github.com/asavartsov/leaflet-measure-path/blob/master/leaflet-measure-path.js#L263 https://github.com/asavartsov/leaflet-measure-path/blob/master/leaflet-measure-path.js#L316

ghost commented 3 years ago

I agree with this one. It was my solution for multipolygons!

Thank you so much for sharing!