Files
gods-eye-view/src/ui/setMapStackReason.test.mjs
T
Said Turksever 98de41c94a feat(street-level): "show me X on Street View" action, street_level view field and sl= links
show_street_level (voice and typed) flies to a place and opens its nearest
street-level photo from Google Street View, Mapillary, KartaView or
Panoramax; Street View switches to Google 3D first. The view model gains a
street_level field, share links carry sl=<source>,<lat>,<lon>, and
show_in_gods_eye_view can open a photo. A plain sl=google link only arms the
point and waits for OPEN, so it never bills a key without a click.

Embed pages show an open photo in an overlay that Esc closes. On-screen
strings are translated into es, ru, zh-CN and zh-Hant. Covered by unit tests
and three new steps in the Street Level browser suite.
2026-11-03 14:32:02 +00:00

34 lines
1006 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import assert from 'node:assert/strict';
import test from 'node:test';
import { StyleManager } from './applicationShell.js';
test('an unavailable map stack reports the controller’s own reason, not always an ion token', async () => {
const controller = {
getStacks: () => [
{
id: 'photoreal',
label: 'Google 3D',
available: false,
unavailableReason: 'Google 3D needs GOOGLE_MAPS_API_KEY',
},
{ id: 'bing-aerial', label: 'Bing aerial', available: false },
],
getActiveId: () => 'osm',
};
const shell = { mapStackController: controller };
const photoreal = await StyleManager.prototype.setMapStack.call(
shell,
'photoreal',
);
assert.deepEqual(photoreal, {
ok: false,
error: 'Google 3D needs GOOGLE_MAPS_API_KEY',
activeStack: 'osm',
});
const bing = await StyleManager.prototype.setMapStack.call(
shell,
'bing-aerial',
);
assert.equal(bing.error, 'Bing aerial requires a Cesium ion token');
});