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
10.89k stars 2.19k forks source link

Some tiles cannot be deleted when zooming in or out #10892

Open WebHero0544 opened 2 years ago

WebHero0544 commented 2 years ago

mapbox-gl-js version: 2.3.1

browser: Google Chrome(92.0.4515.107)

Steps to Trigger Behavior

Hello, I found a problem when using Mapbox-GL-JS. I have been searching for a long time but I don't know what caused the problem. The problem is described as follows(This is always a problem when raster-fader-duration = 0, and occasionally when it is not set):
1.Use the Raster Source to add tiles to the map 2.Zoom out and then zoom in 3.At this point, you can see that the tiles of the previous level are not deleted

Link to Demonstration

'label-tile-source': { "type": "raster", 'tiles': [ 'http://t0.tianditu.com/DataServer?T=cva_w&X={x}&Y={y}&L={z}&tk=b055e3a80de633c788f673dfcb164aa4' ], 'tileSize': 256 }

{ "id": "label-tile-layer", "type": "raster", "source": "label-tile-source", "minzoom": 0, "maxzoom": 12, "layout": {}, "paint": { 'raster-fade-duration': 0 } }

QQ截图20210723151027

Expected Behavior

It is expected that all tiles will be the same size when the map is scaled

Actual Behavior

But now the labels that were not deleted are smaller because the previous layer of tiles was not deleted

rreusser commented 2 years ago

@WebHero0544 Do you see mapbox error events, console errors, or perhaps have a fully reproducible example? The first thing which comes to mind is that a runtime error could cause rendering or tile processing to stop in an unexpected place, which could cause undefined behavior.

WebHero0544 commented 2 years ago

I looked at it. No errors, no warnings.
The code that reproduces the problem:

demo1.zip

WebHero0544 commented 2 years ago

Project startup Mode:

  1. npm install
  2. npm run serve
rreusser commented 2 years ago

Thanks for the test case, @WebHero0544! 🙇 I can confirm that I'm able to reproduce this. I set map.showTileBoundaries = true and see the following (sometimes) after zooming out:

Screen Shot 2021-08-03 at 10 57 30 AM

I'm not sure what's going on yet, but something is not right. This never happens when I use the default mapbox streets style. 🤔

WebHero0544 commented 2 years ago

The above problem does not occur with vector tiles, but it does when using raster tiles. This is bound to come up when I set raster-fader-duration = 0

stepankuzmin commented 1 year ago

Duplicates https://github.com/mapbox/mapbox-gl-js/issues/12241