iTwin / itwinjs-core

Monorepo for iTwin.js Library
https://www.itwinjs.org
MIT License
606 stars 209 forks source link

Background map color turns black when base map visibility is OFF and transparency is turned ON #5021

Open mdastous-bentley opened 1 year ago

mdastous-bentley commented 1 year ago

Bkackground map color turns black when base map visibility is turned off AND background map transparency is more than 0.

To reproduce:

  1. Open a geo-located Bing (i.e you can see the Bing background).

  2. You can turn off the base map visibility by running this key in: fdt set base map visibility false

  3. At point, you should get a white background, which is expected.

  4. Turn ON the transparency option is display-test-app: image

  5. Now the background map is grey (i.e black is half transparency). it should remains white.

This only happens if background map transparency set, if you set base map transparency (i.e fdt set map base transparency), it has no impact.

This appears to be a bug, but might be a limitation when there is no textures to be displayed... to strange thing is, display is correct when no transparency is applied. Maybe we should simply ignore background map transparency when there base map visibility is off (and there is no any other layer).

Might be related to issue 4980

mdastous-bentley commented 1 year ago

I attempted a fix in MapTile.getDrapeTextures() by returning undefined if no imagery tiles were available, which fix the problem if there is no other background map-layers. If a single background map-layers is added, you get a black background again.