mapbox-gl-js
mapbox-gl-js copied to clipboard
"raster-fade-duration" is not respected
Per the style spec, raster layers may specify a raster-fade-duration
.
GL JS ignores this value in some places, instead using a hardcoded value of 300ms, and respects it in others, 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.

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

I would like to just remove this property and either hard-code a default, use the style global transition
duration, or have a separate style-global value like transition
or light
.
@jfirebaugh I would love to do this too, combined with removing individual transition properties altogether (in favor of a global style transition
).
Same issue for me. When I set the layer opacity with map.setPaintProperty('mapbox-satellite', 'raster-opacity', 0)
it fades out at 300ms, no matter what's the value of raster-fade-duration
set at.
Using mapbox-gl-js/v0.45.0
.
I am having this issue as well. When I set raster-fade-duration
to zero on my raster layer, it still appears to have a transition which I change the opacity.
I created a codepen example which demonstrates the issue https://codepen.io/anon/pen/MLMxBW
+1. I am experiencing this issue. Any status update?
For me fading out 1->0 works with a duration. But fading in 0->1 jumps immediately for raster layer. MapboxGL version: 1.13.2