mapbox-gl-draw
mapbox-gl-draw copied to clipboard
Keep midpoint on the line
With the average of Mercator coordinates of the two endpoints, the middle points were drawn off from the line.
By project/unproject the Mercator latitudes to and from screen space, the screen location for midpoints would be fixed onto the line.
Hi @zhangchn,
Thanks for the PR! Could you please review the failing tests in the CI?
IMHO, my patch changed the way midpoints were located. Test cases which assume the midpoints were located the old way failed.