Skip to content

Fix extra coordinate when creating polygons#958

Open
AndrewSepic wants to merge 1 commit intomainfrom
as/fix-extra-point-polygon
Open

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

Conversation

@AndrewSepic
Copy link
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
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.

1 participant