()
| 58 | let iterations = 0; |
| 59 | |
| 60 | function next() { |
| 61 | ++iterations; |
| 62 | ++that.frameState.frameNumber; |
| 63 | |
| 64 | // Keep going until all terrain and imagery provider are ready and states are no longer changing. |
| 65 | let changed = false; |
| 66 | |
| 67 | tiles.forEach(function (tile) { |
| 68 | const beforeState = getState(tile); |
| 69 | GlobeSurfaceTile.processStateMachine( |
| 70 | tile, |
| 71 | that.frameState, |
| 72 | that.terrainProvider, |
| 73 | that.imageryLayerCollection, |
| 74 | ); |
| 75 | const afterState = getState(tile); |
| 76 | changed = |
| 77 | changed || |
| 78 | tile.data.terrainState === TerrainState.RECEIVING || |
| 79 | tile.data.terrainState === TerrainState.TRANSFORMING || |
| 80 | !statesAreSame(beforeState, afterState); |
| 81 | }); |
| 82 | |
| 83 | if (!changed || iterations >= maxIterations) { |
| 84 | resolve(iterations); |
| 85 | } else { |
| 86 | setTimeout(next, 0); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | next(); |
| 91 | }); |
no test coverage detected
searching dependent graphs…