[go: up one dir, main page]

Map.addLayer() fails to resolve if the layer was already initialized

Summary

In the case where the same Layer is added to more than one Map, Map.addLayer() called on the second map will never resolve because it only resolves when the whenReady promise of the Layer resolves. But since it is already initialized, this promise will not trigger the then callback the second time, leaving the Promise returned by addLayer() forever pending.

Steps to reproduce

  1. Create 2 maps (map1 and map2)
  2. Add the same layer to the two maps, but wait for the first layer to be initialized (i.e await map1.addLayer()).

Expected behaviour:

map2.addLayer() resolves eventually.

Actual behaviour:

map2.addLayer() never resolves.

Informations

  • Giro3D version: 0.32.2
  • Browser (Firefox, Chrome, Opera, Safari...) and version: N/A
  • OS (Linux, MacOS, Windows...) N/A