Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double clicking the second vertex when creating a polygon completes the polygon (but it is invalid) #18

Closed
chriserickson opened this issue Apr 15, 2015 · 2 comments

Comments

@chriserickson
Copy link

If you double click the second vertex when creating a polygon, it commits the polygon even though it is invalid.

A seemingly simple fix is to change:

onVertexMarkerClick: function (e) {
...
        } else if (index >= 1 && index === e.vertex.getLastIndex() && this.drawing === L.Editable.FORWARD) {
            this.commitDrawing();

to

onVertexMarkerClick: function (e) {
        } else if (index >= 1 && index === e.vertex.getLastIndex() && this.drawing === L.Editable.FORWARD && this._drawnLatLngs.length >= this.MIN_VERTEX) {
            this.commitDrawing();
111
@yohanboniface
Copy link
Member

Thanks for the report! I wonder how I've let this bug around till now! ;)

@chriserickson
Copy link
Author

Thank you for the prompt fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants