mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
feat(layers): Recent Imagery — open satellite imagery for a selected box (#716)
Select a box on the world and browse the last 30 days of open satellite imagery over it, keyless: NASA GIBS Harmonized Landsat Sentinel-2 (30 m) and the VIIRS daily overview (250 m), with a day strip, IMAGE / VS BASEMAP / A / B modes with a swipe divider, PNG export and share links. The before/after swipe from the Nepal scene moves into shared modules so both use it. Co-authored-by: manjunath22466 <[email protected]>
This commit is contained in:
1 parent
25491f7e33
commit
082074a006
50 files changed
+13169
-440
No files matched your search
@@ -0,0 +1,40 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { NO_IMAGERY_HOST, resolveImageryHost } from './imageryHost.js';
|
||||
|
||||
test('a shown globe hosts imagery on the viewer collection', () => {
|
||||
const imageryLayers = { id: 'globe' };
|
||||
const host = resolveImageryHost({
|
||||
viewer: { scene: { globe: { show: true } }, imageryLayers },
|
||||
tileset: { imageryLayers: { id: 'tiles' } },
|
||||
});
|
||||
assert.deepEqual(host, { collection: imageryLayers, kind: 'globe' });
|
||||
});
|
||||
|
||||
test('a hidden globe hands imagery to the tileset collection', () => {
|
||||
const imageryLayers = { id: 'tiles' };
|
||||
const host = resolveImageryHost({
|
||||
viewer: { scene: { globe: { show: false } }, imageryLayers: {} },
|
||||
tileset: { imageryLayers, isDestroyed: () => false },
|
||||
});
|
||||
assert.deepEqual(host, { collection: imageryLayers, kind: 'tileset' });
|
||||
});
|
||||
|
||||
test('no globe and no tileset means nowhere to drape', () => {
|
||||
assert.deepEqual(
|
||||
resolveImageryHost({
|
||||
viewer: { scene: { globe: { show: false } }, imageryLayers: {} },
|
||||
tileset: null,
|
||||
}),
|
||||
{ collection: null, kind: 'none' },
|
||||
);
|
||||
assert.deepEqual(resolveImageryHost({}), { collection: null, kind: 'none' });
|
||||
assert.deepEqual(
|
||||
resolveImageryHost({
|
||||
viewer: { scene: { globe: { show: false } } },
|
||||
tileset: { imageryLayers: {}, isDestroyed: () => true },
|
||||
}),
|
||||
{ collection: null, kind: 'none' },
|
||||
);
|
||||
assert.match(NO_IMAGERY_HOST, /globe map/);
|
||||
});
|
||||
Reference in new issue
Block a user