mapbox / mapbox-gl-js

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
https://docs.mapbox.com/mapbox-gl-js/
Other
11.2k stars 2.22k forks source link

Panning constraints not working as expected on a huge screen #7622

Open kamakshidasan opened 5 years ago

kamakshidasan commented 5 years ago

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

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

Case 2:

photo6332187597685762066

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

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

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
    });
kamakshidasan commented 5 years ago

Also, whenever there is resize event triggered, I call this line

this.mapboxElement.resize();