mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
- The chip reads GOOGLE STREET VIEW (and its caption link likewise). - Providers declare the imagery filters they honour (`filters`, default pano + since). Street View declares none: every panorama is 360° and it draws no coverage to thin, so its lookups ignore the filters and the panel hides IMAGERY and SINCE while it is the only lit provider. - The legend lists only providers that draw coverage lines, with Selected only beside one: Street View alone shows no legend. - Providers may pick their on-globe marker (`marker`); Street View's is a Google-blue field-of-view cone from a white-ringed dot, in place of GEV's amber pin, and switches back for a Mapillary photo. Co-Authored-By: Claude Opus 5.5 <[email protected]>
69 lines
1.9 KiB
JavaScript
69 lines
1.9 KiB
JavaScript
import { FILTER_DEFAULT } from './policy.js';
|
|
|
|
/**
|
|
* The per-image fields of `state.street` with no image open; closing resets
|
|
* exactly these (host, render mode and follow availability outlive an image).
|
|
*/
|
|
export function freshStreet() {
|
|
return {
|
|
open: false,
|
|
follow: false,
|
|
providerId: null,
|
|
providerName: null,
|
|
providerLabel: null,
|
|
imageId: null,
|
|
position: null,
|
|
bearing: null,
|
|
tilt: null,
|
|
altitude: null,
|
|
isPano: false,
|
|
capturedAt: null,
|
|
/** 'day', or 'month' for providers that date images by month (Google). */
|
|
capturedAtPrecision: 'day',
|
|
/** A place name for the caption (Google's address), or null. */
|
|
title: null,
|
|
/** Whether the open viewer has FIT/FILL render modes. */
|
|
renderModes: true,
|
|
sequenceId: null,
|
|
creator: null,
|
|
externalUrl: null,
|
|
loading: false,
|
|
error: null,
|
|
};
|
|
}
|
|
|
|
/** Mutable core state, created once per layer instance. */
|
|
export function createState({ services }) {
|
|
return {
|
|
services,
|
|
viewer: null,
|
|
enabled: false,
|
|
initialized: false,
|
|
destroyed: false,
|
|
listeners: new Set(),
|
|
notify: null,
|
|
/** Shared imagery filter, in the stored (relative-days) form. */
|
|
filter: { ...FILTER_DEFAULT },
|
|
/** @type {Map<string, {def: object, instance: object, on: boolean}>} */
|
|
providers: new Map(),
|
|
|
|
street: {
|
|
host: null,
|
|
/** Whether the active map stack allows following (Google 3D only). */
|
|
followAvailable: false,
|
|
/** 'letterbox' shows the whole image; 'fill' crops it to the frame. */
|
|
renderMode: 'letterbox',
|
|
...freshStreet(),
|
|
},
|
|
|
|
/** Whether the camera is low enough for a ground click to open an image. */
|
|
groundClickReady: false,
|
|
|
|
/** 'terrain' on Google 3D at street zoom (overlays on the bare earth), else 'draped'. */
|
|
surface: 'draped',
|
|
|
|
marker: { collection: null, billboard: null, look: null },
|
|
clickHandler: null,
|
|
};
|
|
}
|