You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using image tiles with an alpha channel, and the map is zoomed in or out (currently using whole steps), each tile first render a lot darker than it should be. I believe this is because it is first rendered without the alpha channel. This darker version lasts for a fraction of second until the tile is properly rendered. Because this transition is abrupt, it causes a flickering effect.
Expected behavior
No flickering. I expect it to work the same with image tiles containing an alpha channel as it does with those without.
Environment
Leaflet 1.6.0
Tested using Safari 14.0.1, Chrome 87.0.4280.141, and Firefox 84.0.2
On MacOS 10.15.7
Additional context
If the requests are made directly to the image file, this behavior happens in unison across all rendered tiles and isn't very jarring. However, my application generates the tiles on the fly which causes the effects to happen at slightly different times for each tile. This makes for a very unpleasant rendering. To replicate this, I redirect requests to a PHP script.
Minimal example reproducing the issue
Unfortunately, due to needing tiles with varying opacity and sending requests to a PHP script, I am unable to use JS Fiddle. I have decided to create a repository (https://github.com/Thoughtyness/Flicker_Example) that contains everything needed to reproduce this. There are two folders "tiles_with_alpha" and "tiles_without_alpha" which can be used to see that the flickering only occurs when alpha tiles are used. I also left a commented line in index.php which will bypass the PHP script. A copy the code is below:
Current behavior
When using image tiles with an alpha channel, and the map is zoomed in or out (currently using whole steps), each tile first render a lot darker than it should be. I believe this is because it is first rendered without the alpha channel. This darker version lasts for a fraction of second until the tile is properly rendered. Because this transition is abrupt, it causes a flickering effect.Expected behavior
No flickering. I expect it to work the same with image tiles containing an alpha channel as it does with those without.Environment
Leaflet 1.6.0Tested using Safari 14.0.1, Chrome 87.0.4280.141, and Firefox 84.0.2
On MacOS 10.15.7
Additional context
If the requests are made directly to the image file, this behavior happens in unison across all rendered tiles and isn't very jarring. However, my application generates the tiles on the fly which causes the effects to happen at slightly different times for each tile. This makes for a very unpleasant rendering. To replicate this, I redirect requests to a PHP script.Minimal example reproducing the issue
Unfortunately, due to needing tiles with varying opacity and sending requests to a PHP script, I am unable to use JS Fiddle. I have decided to create a repository (https://github.com/Thoughtyness/Flicker_Example) that contains everything needed to reproduce this. There are two folders "tiles_with_alpha" and "tiles_without_alpha" which can be used to see that the flickering only occurs when alpha tiles are used. I also left a commented line in index.php which will bypass the PHP script. A copy the code is below:
index.php:
response.php:
The text was updated successfully, but these errors were encountered: