Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rendering incomplete when using setPadding() #5486

Open
helbling opened this issue Feb 10, 2025 · 4 comments
Open

rendering incomplete when using setPadding() #5486

helbling opened this issue Feb 10, 2025 · 4 comments
Labels
bug Something isn't working PR is more than welcomed Extra attention is needed

Comments

@helbling
Copy link

helbling commented Feb 10, 2025

Somehow the map renders not properly anymore when using map.setPadding() using our styles.

It worked in maplibre-gl-js 4.7.1, and is broken in 5.0.0 and 5.1.0.

Steps to Trigger Behavior

  1. Browse to https://test.twin.search.ch/pub/maplibre_setpadding_5.1.0.html
    using Firefox or Chromium on Linux on a reasonably big display
  2. Rendering is incomplete on the right and left side
  3. On some systems it might be needed to move the map to the right or the left to see the issue

Link to Demonstration

https://test.twin.search.ch/pub/maplibre_setpadding_5.1.0.html

Expected Behavior

Map renders properly everywhere.

https://test.twin.search.ch/pub/maplibre_setpadding_4.7.1.html works properly.

Actual Behavior

Map doesn't render properly on the left and right side. See screenshots.

5.1.0:
Image

4.7.1:
Image

@HarelM HarelM added bug Something isn't working PR is more than welcomed Extra attention is needed labels Feb 10, 2025
@HarelM
Copy link
Collaborator

HarelM commented Feb 10, 2025

Can you please create a minimal reproduction with minimal layers using jsbin or equivalent?
Having said that, padding is a complicated issue, feel free to try and find the offending PR as part of the 5.0 pre-releases to see which PR broke this behavior.

@helbling
Copy link
Author

helbling commented Feb 11, 2025

5.0.0-pre.5 is good,
5.0.0-pre.6 is affected.

will provide a more minimal reproduction tomorrow

@helbling
Copy link
Author

helbling commented Feb 12, 2025

Got it down to one layer and put it in a jsbin to play around:
https://jsbin.com/xulasimara/1/edit?output

NOTE: make the output window as big as possible for better reconstruction

 <!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/maplibre-gl@5.0.0-pre.6/dist/maplibre-gl.js"></script>
<link href="https://unpkg.com/maplibre-gl@5.0.0-pre.6/dist/maplibre-gl.css" rel="stylesheet" />
</head>

<body>
<style>
  body, html, #map { height: 100%; width: 100% }
</style>
<div id="map"></div>
<script>
    var map = new maplibregl.Map({
        style:  {
          "version": 8,
          "sources": {
            "sym_vector": {
              "type": "vector",
              "url": "https://search.ch/map.vector/tilejson/sym_vector.json"
            }
          },
          "layers": [{
            "type": "fill",
            "paint": { "fill-color": "green" },
            "source": "sym_vector",
            "source-layer": "wood",
            "id": "wood"
          }]
        },
        center:    [ 7.881186, 46.291304 ],
        zoom:      11,
        container: 'map',
        hash: true
    });
    map.showPadding = 1;
    map.setPadding({ top:100, left: 300, bottom:100, right: 300 });
</script>

</body>
</html>

@HarelM
Copy link
Collaborator

HarelM commented Feb 12, 2025

I'm guessing this is related to the covering tiles changes made as part of pre-release 6.
@NathanMOlson any chance you can take a look at this issue?
When increasing the size of the screen the following is happening on the above jsbin:
pre.6:

Image

pre.5:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PR is more than welcomed Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants