Closed m0t0r closed 5 years ago
Will close until this has more upvotes. But definitely something I want to add within the next months! Thank you for the suggestion.
Hey @codeofsumit,
I would have the same feature request about distance/angle distance while drawing polygons/polylines.
Is there a way to pass a custom function to pm while drawing each segment of a polygon, which would enable to display these parameters ?
Thanks a lot,
@sbilbault I think there are other plugins that offer that functionality. leaflet-measure-path for example.
turf.js
works really well for calculating area.
turf.area(layer.toGeoJSON())
the method described by @kunKun-tx works perfectly for polygons with distinct vertices. does anyone know if a way to calculate the area of a drawn circle? my existing function throws no errors however the geometry object which the circle generates only contains one coordinate pair (the center point) so the area is always calculated as 0. Any suggestions?
@bw1984
it's probably easier to calc the circle area using its raduis layer.getRadius()
?
ref: https://leafletjs.com/reference-1.6.0.html#circlemarker-getradius
I all, this feature is now implemented in Leaflet-Geoman Pro which is the way we fund the development of this open-source library. Eventually, features of the Pro version will trickle down to the OSS library which is happening already with many features. If you use Leaflet-Geoman in a professional environment, please consider going for the Pro version to get more features and support this open source project.
Hey @codeofsumit,
Thanks a lot for this project and your time!
I have been looking around the documentation and repo and was unable to find support for showing sq area/distance when drawing polygons/polylines/circles. I guess it's a feature request. I hope it can be added to this awesome library.
Thanks a lot!