mapbox / mapbox/mapbox-gl-js

Markers that are "behind" the map's starting centerpoint have incorrect initial positions when using globe projection

Open
#13,000 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

**mapbox-gl-js version**: 3.0.0

**browser**: Chrome 119.0.6045.199

### Steps to Trigger Behavior
1. Open JSFiddle demo
2. Notice that the markers that are supposed to be initially invisible (due to being "behind" the map's starting centerpoint) are visible for a split second when the map loads, and are then hidden from view

### Link to Demonstration
https://jsfiddle.net/philiplindberg/f90awpms/23/

https://github.com/mapbox/mapbox-gl-js/assets/1865904/24913342-fdb9-446e-a300-37e24d06fef3

### Expected Behavior
I would expect all markers to appear in their correct positions, regardless of the projection used.

### Actual Behavior
Markers that should initially be invisible (due to being "behind" the map's starting centerpoint) are actually visible for a split second before being correctly hidden.

### Workaround
Using the `mercator` projection resolves the issue.

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 linked JSFiddle reproduction and compare marker initialization under the globe and mercator projections. Trace why markers behind the map's starting centerpoint are briefly visible during globe loading; done means those markers never flash before being hidden.

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.