mapbox / mapbox/mapbox-gl-js

Panning constraints not working as expected on a huge screen

Open
#7,622 1 comment 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

Hi,

I'm using mapbox-gl on a high resolution ultra-wall. Panning does not work as expected in some scenarios in v0.48.0

Case 1:

![photo6332412705511680073](https://user-images.githubusercontent.com/9362064/49018258-3e228d00-f18b-11e8-8076-5833abf60e89.jpg)

This seems to work fine. Only horizontal panning is present.

Case 2:

![photo6332187597685762066](https://user-images.githubusercontent.com/9362064/49018305-5b575b80-f18b-11e8-9c23-88f53ed0f8b8.jpg)

In this case, after resizing slightly, the topmost part of Greenland gets cut and I can't pan upwards as well.

This issue gets worse, if I resize to the entire size of the wall [14380 x 4015]

![photo6332412705511680074](https://user-images.githubusercontent.com/9362064/49018540-f6e8cc00-f18b-11e8-890e-f47c90751133.jpg)

I can't pan upwards at all, to see the upper part of Africa. Ideally, I would want to see the same as Case 3 below.

Case 3:

If I instantiate mapbox to the entire size of the wall, at the beginning, without trying to resize, then it seems to work fine.

![photo6332412705511680076](https://user-images.githubusercontent.com/9362064/49018681-51822800-f18c-11e8-8412-0eac43d608bb.jpg)

My guess is that something is glitchy after resizing.

Here is my setup [if it helps]

this.mapboxElement = new mapboxgl.Map({
container: 'map_' + this.id,
style: 'mapbox://styles/mapbox/streets-v9',
maxZoom: 10,
minZoom: 1
});

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 three resizing scenarios with mapbox-gl v0.48.0 using the shown Map constructor, especially the 14380 × 4015 wall size. Compare panning constraints after resizing with constraints when the map is initialized at its final size. Done means the upper map areas remain reachable after resizing without breaking the expected horizontal constraints.

Written by the indexing model from the issue text.

Assessment

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