Skip to content

Fix midpoints locations#1433

Closed
romain-tracktik wants to merge 1 commit intomapbox:mainfrom
romain-tracktik:midpoint-fix
Closed

Fix midpoints locations#1433
romain-tracktik wants to merge 1 commit intomapbox:mainfrom
romain-tracktik:midpoint-fix

Conversation

@romain-tracktik
Copy link
Contributor

Fixes the midpoint location, so they appear on the polygon lines.

Issues was that the midpoint calculation was done in Mercator WGS84, whereas the projection is in Web Mercator.

  • Uses @turf/projection for the conversion
  • Fixed tests to accommodate for the new midpoint position

Closes #1073.

Any feedback is welcomed.


Before :

Screenshot 2025-08-04 at 22 17 09

After :

Screenshot 2025-08-04 at 22 14 44 Screenshot 2025-08-04 at 22 15 06

@romain-tracktik romain-tracktik requested a review from a team as a code owner August 6, 2025 14:46
@underoot underoot self-requested a review October 28, 2025 13:48
@underoot
Copy link
Member

Thank you! It looks good. I will need to merge it manually later. Thank you for the contribution!

@underoot underoot mentioned this pull request Nov 3, 2025
@underoot underoot closed this Nov 3, 2025
@underoot underoot mentioned this pull request Nov 3, 2025
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.

midpoint handles misplaced with non-mercator projections

2 participants