Skip to content

Fix extra coordinate when creating polygons#958

Merged
AndrewSepic merged 1 commit intomainfrom
as/fix-extra-point-polygon
Apr 2, 2026
Merged

Fix extra coordinate when creating polygons#958
AndrewSepic merged 1 commit intomainfrom
as/fix-extra-point-polygon

Conversation

@AndrewSepic
Copy link
Copy Markdown
Contributor

@AndrewSepic AndrewSepic commented Feb 27, 2026

This PR fixes a bug when creating polygons and terminating the drawing with a double click. Previously when closing the polygon with a doubleclick there was an additional duplicate coordinate created. ie: a 4 sided polygon had 6 coordinates instead of 5.

This fixes the extra coordinate, properly handling how browsers register clicks. When double clicking on the Map 3 points are actually created, therefore the splice() method needed to remove an additional point. The line.ts handler (which works as expected) already follows this pattern.

@AndrewSepic AndrewSepic requested a review from a team as a code owner February 27, 2026 17:54
Copy link
Copy Markdown
Contributor

@chriswhong chriswhong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, works as expected.

@AndrewSepic AndrewSepic merged commit f777a4e into main Apr 2, 2026
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants