Open abhi5057 opened 3 months ago
The issue is seen in readableArea function in leaflet.draw's code base. There's a wrong reference to type variable and hence we see the issue.
readableArea: function (area, isMetric, precision) {
var areaStr,
units,
precision = L.Util.extend({}, defaultPrecision, precision);
if (isMetric) {
units = ['ha', 'm'];
type = typeof isMetric;
if (type === 'string') {
units = [isMetric];
} else if (type !== 'boolean') {
units = isMetric;
}
Instead if we change to this.type in all the 3 references to type variable here, then we're able to draw rectangle, however we're unable to see its area while creating the rectangle though.
How to reproduce
What behaviour I'm expecting and which behaviour I'm seeing
Expectation: I should've been able to create a rectangle by clicking and dragging the cursor. Observation: We're unable to drag the cursor to create a rectangle.
Minimal example reproducing the issue