Raster tiles are always retained when `raster-fade-duration` is set to `0`
Nobody has claimed this yet.
- 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`.

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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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