mapbox / mapbox/mapbox-gl-draw
midpoint handles misplaced with non-mercator projections
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 612
- Avg merge
- 8d 9h
- Merged PRs (30d)
- 5
Description
**mapbox-gl-js version**: v2.6.0-beta.1
**mapbox-gl-draw version**: main
### Steps to Trigger Behavior
1. map.setProjection('winkelTripel')
2. draw polygon
### Expected Behavior
Midpoints are drawn on the line.
### Actual Behavior
Midpoints are drawn off the line.

I think we might need to interpolate in MercatorCoordinate in stead of LngLat here: https://github.com/mapbox/mapbox-gl-draw/blob/main/src/lib/create_midpoint.js
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/lib/create_midpoint.js and reproduce the issue using map.setProjection('winkelTripel') before drawing a polygon. Compare the midpoint positions with the polygon line and verify that the behavior also remains correct under the affected non-Mercator projection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100