Skip to content

Commit

Permalink
Merge pull request #200 from Zverik/master
Browse files Browse the repository at this point in the history
Leave at least 3 points in a polygon
  • Loading branch information
jacobtoye committed Oct 3, 2013
2 parents 5fe72c5 + be6807e commit 534b3da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/edit/handler/Edit.Poly.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ L.Edit.Poly = L.Handler.extend({

_onMarkerClick: function (e) {
// we want to remove the marker on click, but if latlng count < 3, polyline would be invalid
if (this._poly._latlngs.length < 3) { return; }
if (this._poly._latlngs.length < (L.Polygon && (this._poly instanceof L.Polygon) ? 4 : 3)) { return; }

var marker = e.target;

Expand Down

0 comments on commit 534b3da

Please sign in to comment.