Skip to content

Commit

Permalink
Fix regression bug where area would never show for polygons.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtoye committed Jan 27, 2014
1 parent 26a1cea commit 4ae269f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/draw/handler/Draw.Polygon.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,17 @@ L.Draw.Polygon = L.Draw.Polyline.extend({
return this._markers.length >= 3;
},

_vertexAdded: function () {
_vertexChanged: function (latlng, added) {
var latLngs;

// Check to see if we should show the area
if (this.options.allowIntersection || !this.options.showArea) {
return;
}
if (!this.options.allowIntersection && this.options.showArea) {
latLngs = this._poly.getLatLngs();

var latLngs = this._poly.getLatLngs();
this._area = L.GeometryUtil.geodesicArea(latLngs);
}

this._area = L.GeometryUtil.geodesicArea(latLngs);
L.Draw.Polyline.prototype._vertexChanged.call(this, latlng, added);
},

_cleanUpShape: function () {
Expand Down

0 comments on commit 4ae269f

Please sign in to comment.