mapbox / mapbox/mapbox-gl-js

"raster-fade-duration" is not respected

Open
#3,526 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug :lady_beetle: needs discussion :speech_balloon:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

[Per the style spec, raster layers may specify a `raster-fade-duration`](https://www.mapbox.com/mapbox-gl-style-spec/#paint-raster-fade-duration).

GL JS [ignores this value in some places](https://github.com/mapbox/mapbox-gl-js/blob/master/js/style/style.js#L237), instead using a hardcoded value of 300ms, and [respects it in others](http://github.com/mapbox/mapbox-gl-js/blob/master/js/render/draw_raster.js#L108-L109), leaving some images marooned below their intended opacity.

**mapbox-gl-js version**: v0.26.0

### Steps to Trigger Behavior

view http://jsbin.com/mowadacuju/1/edit?html,output

### Expected Behavior

The map's animation loop runs for the duration of the layer's `raster-fade-duration`, allowing the image to reach its desired opacity.

screen shot 2016-11-02 at 6 28 37 pm

### Actual Behavior

The map's animation loop runs only for 300ms, leaving the image at an opacity below its desired opacity.

screen shot 2016-11-02 at 6 28 33 pm

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

Start with the JSBin reproduction, then compare the raster-fade-duration handling in js/style/style.js around line 237 with js/render/draw_raster.js around lines 108-109. Trace how the animation loop is scheduled and verify that it continues for the layer's configured duration, allowing the raster image to reach its intended opacity.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.