I've seen that in some examples using leaflet draw, after drawing the third point, a popup shows the area of the drawn item on the map. I'm unable to replicate this function even setting the
polygon: {
showArea: true,
},
Here's my code (angular 13)
var drawnItems = new L.FeatureGroup();
this.map.addLayer(drawnItems);
var drawControl = new L.Control.Draw({
draw: {
polygon: {
showArea: true,
},
marker: false
},
edit: {
featureGroup: drawnItems,
}
});
this.map.addControl(drawControl);
this.map.on('draw:created', function (e) {
const type = (e as L.DrawEvents.Created).layerType,
layer = (e as L.DrawEvents.Created).layer;
drawnItems.addLayer(layer);
});
Could you suggest how to do it?