mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

"raster-fade-duration" is not respected

Open lucaswoj opened this issue 8 years ago • 7 comments

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.

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

lucaswoj avatar Nov 03 '16 01:11 lucaswoj

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 avatar Nov 03 '16 01:11 jfirebaugh

@jfirebaugh I would love to do this too, combined with removing individual transition properties altogether (in favor of a global style transition).

mourner avatar Nov 03 '16 01:11 mourner

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.

bplmp avatar Jun 23 '18 19:06 bplmp

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.

sdfricke avatar Feb 20 '19 19:02 sdfricke

I created a codepen example which demonstrates the issue https://codepen.io/anon/pen/MLMxBW

sdfricke avatar Feb 25 '19 14:02 sdfricke

+1. I am experiencing this issue. Any status update?

CharlesTaylor-FW avatar Oct 08 '19 19:10 CharlesTaylor-FW

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

blq avatar Nov 15 '22 12:11 blq