mapbox / mapbox/mapbox-gl-js

Lines not drawn correctly on globe projection

Open
#13,121 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

I am using mapbox to render an airplane flight from San Francisco, CA to Dubai. The flight should be rendered using the "shortest direct distance" over the north pole, but is rendered by MapBox GL incorrectly as flying east across the US and over the Atlantic Ocean.

The ideal shortest path is about 7000 nm and the path as displayed is approximately 9200 nm.

**mapbox-gl-js version**: 3.2.0

**browser**: Safari 17.4 (19618.1.15.11.12)

### Steps to Trigger Behavior

1. Draw a line from ``-122.375, 37.61899948120117`` to ``55.3643989563, 25.2527999878``

### Link to Demonstration

https://codepen.io/mrjbq7/pen/JjVEKgm

### Expected Behavior

OMDB Dubai International

### Actual Behavior

Screenshot 2024-03-18 at 11 23 27 AM

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CodePen reproduction and the supplied coordinates in mapbox-gl-js 3.2.0, then trace the globe projection's line-rendering path. Compare the rendered route with the expected shortest direct path over the north pole; done means the line follows that route in the demonstrated case without regressing other globe lines.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
computer-graphics, frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.