Skip to content

A spy satellite simulator in your browser, except the data is real. Live open source spatial intelligence on a photorealistic 3D globe.

Explain empty imagery configuration in Street Level controls

Sameh Khamis1ee07468c46f
diff --git a/src/ui/streetLevelPresentation.js b/src/ui/streetLevelPresentation.js
index af6ad8c8c..da3140b24 100644
--- a/src/ui/streetLevelPresentation.js
+++ b/src/ui/streetLevelPresentation.js
@@ -125,6 +125,7 @@ function presentViewer(state) {
}
function presentMeta(state) {
+ if (state.providers.length === 0) return state.coverage.hint || '';
if (!state.enabled) return 'Switch a provider on to draw its coverage.';
if (state.sequence.selectedId)
return state.sequence.loading
@@ -147,7 +148,7 @@ export function presentStreetLevelPanel(state, { now = Date.now() } = {}) {
enabled,
keyRequired,
status: presentStatus(state),
- controlsDisabled: keyRequired,
+ controlsDisabled: keyRequired || state.providers.length === 0,
providers: presentProviders(state),
error: keyMissing
? null
diff --git a/src/ui/streetLevelPresentation.test.mjs b/src/ui/streetLevelPresentation.test.mjs
index d5075ac69..d2a24c94a 100644
--- a/src/ui/streetLevelPresentation.test.mjs
+++ b/src/ui/streetLevelPresentation.test.mjs
@@ -9,6 +9,23 @@ import { providerSnapshot } from '../testSupport/streetLevelFakes.mjs';
const provider = providerSnapshot;
+test('an empty composition explains unavailable imagery even while disabled', () => {
+ for (const enabled of [false, true]) {
+ const view = presentStreetLevelPanel(
+ snapshot({
+ enabled,
+ providers: [],
+ coverage: { hint: 'No street-level imagery providers configured' },
+ legend: [],
+ }),
+ );
+ assert.equal(view.controlsDisabled, true);
+ assert.equal(view.keyRequired, false);
+ assert.deepEqual(view.providers, []);
+ assert.equal(view.meta, 'No street-level imagery providers configured');
+ }
+});
+
function snapshot(overrides = {}) {
const base = {
enabled: false,