how to calculate area of polygon using Leaflet.Draw GeometryUtil

后端 未结 1 913
遇见更好的自我
遇见更好的自我 2021-01-28 09:43

I read this answer on how to calculate the area of a polygon and I am trying to achieve the same. However, I consistently get 0 (zero) for the area.

JS fiddle is here. T

相关标签:
1条回答
  • 2021-01-28 10:23

    You should add .getLatLngs() see this fiddle

    L.GeometryUtil.geodesicArea(polygon.getLatLngs()));
    
    0 讨论(0)
提交回复
热议问题