mapbox / mapbox/mapbox-gl-js

Equirectangular projection jumps when `render-world-copies` is false.

Open
#12,385 0 comments 0 reactions 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**: main

**browser**: Chrome and Firefox

### Steps to Trigger Behavior

1. Make a map with `projection:'equirectangular'`
2. setRenderWorldCopies(false)`
2 Pan off left edge of map.

https://user-images.githubusercontent.com/14878684/201788289-6b51b01e-d28e-4f23-bcd2-8d63df155135.mov

### Expected Behavior
Map should stop moving on the left side, as does Mercator

### Actual Behavior
Map jumps to the right.

This is probably caused by `equirectangular `using the same code paths as non-rectangular projections to determine where to snap. Using the same behavior as Mercator should solve this issue.

Maybe related to https://github.com/mapbox/mapbox-gl-js/issues/11406

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

Reproduce the issue in Chrome or Firefox with an equirectangular map, render-world-copies disabled, and a pan past the left edge. Inspect the projection snapping paths and compare equirectangular behavior with Mercator and the related issue #11406; done means the map stops at the left edge instead of jumping right.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.