mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Merge origin/main: street-level links, embed terrain waits, Swedish, and host-supplied weather frames on the renderer's ports
A weather frame source's regional tiles reach the renderer through the imagery layer's fetchTile, drawn and handed over as PNG bytes, a null tile one shared transparent tile; the camera-owner watch listens on the renderer's canvas.
This commit is contained in:
commit
c57e535275
110 files changed
+12262
-168
No files matched your search
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
import { t, msg } from './i18n/index.js';
|
||||
import { canvasOf } from './render/rendererOf.js';
|
||||
|
||||
export const NAVIGATION_AUTHORITY_EVENT = 'gev:navigation-authority-taken';
|
||||
|
||||
@@ -181,3 +182,37 @@ export function reassertNavigationHandoff({
|
||||
release?.();
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Gestures on the globe that take the camera from a pending request. */
|
||||
const CAMERA_GESTURES = ['pointerdown', 'wheel'];
|
||||
|
||||
/**
|
||||
* Whether the camera is still a request's: a navigation the shell stamps (a
|
||||
* search, the assistant, a link) or a press or wheel on the globe hands it to
|
||||
* someone else. `claim()` takes the navigation stamped so far as the
|
||||
* request's (its own flight); a gesture is never forgiven. `stop()` removes
|
||||
* the gesture listeners.
|
||||
*/
|
||||
export function watchCameraOwner(viewer, navigation) {
|
||||
let generation = navigation?._navigationGeneration;
|
||||
const canvas = canvasOf(viewer);
|
||||
let taken = false;
|
||||
const onGesture = () => {
|
||||
taken = true;
|
||||
};
|
||||
for (const type of CAMERA_GESTURES)
|
||||
canvas?.addEventListener?.(type, onGesture, { passive: true });
|
||||
return {
|
||||
claim: () => {
|
||||
generation = navigation?._navigationGeneration;
|
||||
},
|
||||
taken: () =>
|
||||
taken ||
|
||||
(Number.isFinite(generation) &&
|
||||
navigation._navigationGeneration !== generation),
|
||||
stop: () => {
|
||||
for (const type of CAMERA_GESTURES)
|
||||
canvas?.removeEventListener?.(type, onGesture);
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user