mapbox / mapbox/mapbox-gl-js

Raster tiles are always retained when `raster-fade-duration` is set to `0`

Open
#12,241 0 comments 1 reaction 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

GL JS always retains raster tiles if `raster-fade-duration` is set to `0`.

Screen Shot 2022-09-16 at 13 30 47

It's most likely related to how we handle fading tiles in SourceCache.

https://github.com/mapbox/mapbox-gl-js/blob/bf9964eba975ed2f82294c1d906787a93050cfff/src/source/source_cache.js#L559-L568

Also related to https://github.com/mapbox/mapbox-gl-js/pull/4034

### Steps to Trigger Behavior

1. Add raster source
2. Set `raster-fade-duration` to `0`
3. Zoom out and see that children tiles are still retained

### Link to Demonstration

https://codepen.io/stepankuzmin/pen/zYjNQWM

### Expected Behavior

Parent tiles should replace children tiles

### Actual Behavior

Children tiles are retained, parent tiles aren't drawn

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

Read src/source/source_cache.js around the linked lines and reproduce the behavior using the CodePen demonstration with raster-fade-duration set to 0. Trace how fading tiles are retained during zoom changes, then verify that parent tiles replace child tiles and that the existing behavior remains correct for nonzero fade durations.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.