mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Add a globe visibility getter to the renderer contract
The globe port could show or hide the globe surface but not say whether it is shown. It now has an optional isGlobeVisible(), gated by a new globeVisibility capability, in the Cesium adapter, the stub and a conformance check. A Cesium scene without a globe does not offer it, so callers keep their own default for an unknown surface. The OSM overlays, the CCTV ground regime and the submarine cable drape now read the getter instead of the scene's globe. cableClassificationTypeForScene takes the viewer rather than its scene.
This commit is contained in:
1 parent
23d56f8393
commit
2e91579f8f
23 files changed
+140
-29
No files matched your search
@@ -4,7 +4,13 @@ import * as Cesium from 'cesium';
|
||||
import { createCesiumGlobe, markBaseTileset } from './globe.js';
|
||||
import { hookProvider, TILE_RETRY_DELAY_MS, xyzTileUrl } from './imagery.js';
|
||||
|
||||
const ALL = new Set(['imageHooks', 'imageryOnTiles', 'splitSwipe', 'terrain']);
|
||||
const ALL = new Set([
|
||||
'imageHooks',
|
||||
'imageryOnTiles',
|
||||
'splitSwipe',
|
||||
'terrain',
|
||||
'globeVisibility',
|
||||
]);
|
||||
const url = (name) => `https://${name}.invalid/{z}/{x}/{y}.png`;
|
||||
|
||||
function fakeScene() {
|
||||
@@ -458,8 +464,14 @@ test('globe visibility, settling and progress', () => {
|
||||
const { scene, port, tick } = setup();
|
||||
port.setGlobeVisible(false);
|
||||
assert.equal(scene.globe.show, false);
|
||||
assert.equal(port.isGlobeVisible(), false);
|
||||
assert.equal(port.isSettled('terrain'), true, 'a hidden globe loads nothing');
|
||||
port.setGlobeVisible(true);
|
||||
assert.equal(port.isGlobeVisible(), true);
|
||||
// It reads the scene, whoever changed it.
|
||||
scene.globe.show = false;
|
||||
assert.equal(port.isGlobeVisible(), false);
|
||||
scene.globe.show = true;
|
||||
scene.globe.tilesLoaded = false;
|
||||
assert.equal(port.isSettled('terrain'), false);
|
||||
assert.equal(port.isSettled('base'), false);
|
||||
|
||||
Reference in new issue
Block a user