mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 10:12:18 +00:00
Vue kit: Street Level's photo viewer is a view with kit buttons
The photo viewer KartaView and Panoramax share (photoViewer.js) no longer builds its root, picture, panorama canvas and ‹ › buttons in script. It presents them through subscribeView(), which the street-level layer gathers in subscribePhotoViewer(); the application shell publishes that to the gev-street-level-photo store, and StreetLevelPhotoViewer, beside the Street Level panel in the layer panels, teleports the viewer into the viewer host with the same classes, data attributes, labels and order. Its ‹ and › are ghost UiButtons. The view forwards keys, pointers, wheel, the step clicks and a lost WebGL context to the viewer and hands each element back: the canvas the panorama is drawn on (a fresh, keyed one after a lost context, which an open now waits for), and the frame, picture, root and buttons the viewer measures and keeps focus with. The viewer keeps every decision: loading, upgrades, size limits, keys, drag, pinch, zoom, Esc on the viewer's box and focus when a step button disables. The street-level layer still needs no Vue; with no view subscribed these photos cannot mount, which docs/VUE-MIGRATION.md records. The provider and viewer tests draw the viewer with a fake view in kartaViewFakes.mjs; StreetLevelPhotoViewer.test.mjs runs the real view on a page, and streetLevelPhotoControls.test.mjs pins the kit controls. The panel page's lost-graphics notice in globePanelRuntime.js stays built in script, as the document now says. Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
9423a26487
commit
766364f691
20 files changed
+911
-112
No files matched your search
@@ -190,7 +190,7 @@ test('the nearest photo is the closest within 50 m, and opening it asks nothing
|
||||
});
|
||||
const id = await instance.nearestImage({ lat: 42.3314, lon: -83.0458 });
|
||||
assert.equal(id, 'near');
|
||||
const host = fakeHost();
|
||||
const host = fakeHost(instance.viewer);
|
||||
await instance.viewer.mount(host);
|
||||
await instance.viewer.open(id);
|
||||
assert.deepEqual(source.calls.photo, [], 'the lookup filled the cache');
|
||||
@@ -285,7 +285,7 @@ const press = async (button, opened) => {
|
||||
|
||||
async function mounted(sourceOptions, contextOptions) {
|
||||
const env = setup(sourceOptions, contextOptions);
|
||||
const host = fakeHost();
|
||||
const host = fakeHost(env.instance.viewer);
|
||||
await env.instance.viewer.mount(host);
|
||||
const poses = [];
|
||||
env.instance.viewer.onPose((pose) => poses.push(pose.imageId));
|
||||
@@ -970,7 +970,7 @@ test('after a GPU reset the photo is drawn again by the viewer, not through the
|
||||
context.actions.reportError = (message) => errors.push(message);
|
||||
const instance = definition.create(context);
|
||||
actions.instance = instance;
|
||||
const host = fakeHost();
|
||||
const host = fakeHost(instance.viewer);
|
||||
await instance.viewer.mount(host);
|
||||
const poses = [];
|
||||
instance.viewer.onPose((pose) => poses.push(pose.imageId));
|
||||
@@ -1010,7 +1010,7 @@ test('the marker is KartaView’s own cone, and it points along the drive, not a
|
||||
photos: page.photos.map((record) => ({ ...record, heading: '200' })),
|
||||
};
|
||||
};
|
||||
const host = fakeHost();
|
||||
const host = fakeHost(env.instance.viewer);
|
||||
await env.instance.viewer.mount(host);
|
||||
const bearings = [];
|
||||
env.instance.viewer.onPose((pose) => bearings.push(pose.bearing));
|
||||
@@ -1101,7 +1101,7 @@ test('a sequence page that lands while a lost GPU context recovers still draws i
|
||||
const instance = definition.create(context);
|
||||
actions.instance = instance;
|
||||
const cones = await withCones(t, { instance });
|
||||
const host = fakeHost();
|
||||
const host = fakeHost(instance.viewer);
|
||||
await instance.viewer.mount(host);
|
||||
await instance.viewer.open('p-0');
|
||||
// › to the next panorama; the GPU resets while it loads.
|
||||
|
||||
Reference in new issue
Block a user