mapbox-gl-draw icon indicating copy to clipboard operation
mapbox-gl-draw copied to clipboard

Keep midpoint on the line

Open zhangchn opened this issue 3 years ago • 2 comments

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.

zhangchn avatar Jan 09 '23 10:01 zhangchn

Hi @zhangchn,

Thanks for the PR! Could you please review the failing tests in the CI?

stepankuzmin avatar Jun 26 '23 10:06 stepankuzmin

IMHO, my patch changed the way midpoints were located. Test cases which assume the midpoints were located the old way failed.

zhangchn avatar Jun 27 '23 11:06 zhangchn