mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 16:52:20 +00:00
fix(globe): harden the Navara engine after review
- maps: photoreal hides the base imagery layer instead of deleting it, and a new base layer goes in before the old one goes: deleting the last raster layer stops Navara 0.2.1 loading terrain at the current view, which left terrainHeight undefined under the tiles - Google 3D tiles open Navara's attribution card so the tiles' copyright lines are on screen, as Cesium shows them; onScreen credits do the same - setCameraInputs merges into the camera options set through the engine (new setCameraOptions extension) instead of resetting them - createNavaraGlobe disposes the view and canvas if the engine throws - the pin test checks the installed Navara version and catches bracketed private access - QA: draw-match checks at the nadir clamp, after a Navara flight and after a mouse drag; terrain under photoreal set right away; the copyright lines on screen; create/destroy/create leaves no canvas, frames, animation frames, workers or console errors (54/54)
This commit is contained in:
1 parent
90c8e7763a
commit
a4ac0b9b0d
8 files changed
+148
-25
No files matched your search
@@ -4,8 +4,12 @@ import { createNavaraCredits } from './credits.js';
|
||||
|
||||
function fakeAttribution() {
|
||||
const shown = [];
|
||||
return {
|
||||
const attribution = {
|
||||
shown,
|
||||
opened: 0,
|
||||
show() {
|
||||
attribution.opened++;
|
||||
},
|
||||
add(items) {
|
||||
for (const item of items)
|
||||
if (!shown.some((entry) => entry.attributionHtml === item.attributionHtml))
|
||||
@@ -20,6 +24,7 @@ function fakeAttribution() {
|
||||
}
|
||||
},
|
||||
};
|
||||
return attribution;
|
||||
}
|
||||
|
||||
test('addStatic shows HTML in the attribution and the remover is idempotent', () => {
|
||||
@@ -55,3 +60,12 @@ test('destroy removes every credit; a view without attribution UI is a no-op', (
|
||||
const remove = bare.credits.addStatic('A');
|
||||
remove();
|
||||
});
|
||||
|
||||
test('onScreen credits open the attribution list on screen; others do not', () => {
|
||||
const attribution = fakeAttribution();
|
||||
const { credits } = createNavaraCredits({ attribution });
|
||||
credits.addStatic('Quiet');
|
||||
assert.equal(attribution.opened, 0);
|
||||
credits.addStatic('Loud', { onScreen: true });
|
||||
assert.equal(attribution.opened, 1);
|
||||
});
|
||||
Reference in new issue
Block a user