mapbox / mapbox/mapbox-gl-js

setting `maxBounds` on `equirectangular` projection has different results based on the map container size

Open
#13,290 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

**mapbox-gl-js version**:
v3.6.0

**browser**:
Chrome

### Steps to Trigger Behavior

1. Set two maps, one with a smaller vertical container than the other. Both maps have the same configuration, using equirectangular projection.
2. Set the same maxBounds to both maps.
3. Notice that the maxBounds for the first map and the second map do not behave the same.

### Link to Demonstration

https://codepen.io/pflopez/pen/xxvbZdB

### Expected Behavior

Both maps should have the same max bounds, regardless of the size of the map container.

### Actual Behavior

The max bounds of each map are different.

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 CodePen demonstration and trace the map maxBounds behavior for the equirectangular projection while comparing containers of different heights. Reproduce the discrepancy, then verify that identical maxBounds produce identical behavior across both map sizes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
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.