checking size of Polygon drawn with Leaflet l.draw.polyline -


i've made website leaflet draw polygons on osm-map.

now want check size of polygon, because polygon must not exceed defined size, example, 5 square kilometers.

does have idea check size of drawn polygon?

i have used leaflet.draw ( https://github.com/leaflet/leaflet.draw ) draw polygon.

and has geodesicarea function. sample in 'draw:created'.

    map.on('draw:created', function (e) {         var type = e.layertype,             layer = e.layer;             if (type === 'polygon')              {                 var area = l.geometryutil.geodesicarea(layer.getlatlngs())                 ... 

Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -