diff --git a/DATA_SOURCES.md b/DATA_SOURCES.md index f8da1e26c7..cb9da66e43 100644 --- a/DATA_SOURCES.md +++ b/DATA_SOURCES.md @@ -432,7 +432,7 @@ The [Bhote Koshi event pack](public/events/bhote-koshi-2026/README.md), under `p | **Yale Bright Star Catalogue** (9,096 stars, sky background) | `sky/` | **Public domain** | ✅ (no restrictions) | "Yale Bright Star Catalogue (Hoffleit & Warren, via CDS)" (courtesy credit) | | **ESO Milky Way panorama** (eso0932a, blurred cube map, sky background) | `sky/` | **CC BY 4.0** | ✅ (attribution; changes stated) | "ESO/S. Brunier" | | **CCTV ground heights** (3,445 cameras) | `cctv_ground_heights/` | Precomputed camera placement heights, aligned to work with Google Photorealistic 3D Tiles (folder README) | — | — | -| **CCTV Camera Database** model-enrichment extract v2.26.0 + v2.29.0 (20 camera-model records) | `src/layers/cctv/modelSpecs.js` | **CC0-1.0** (public domain dedication) | ✅ (no restrictions) | "Specs: cctv-database.com" (courtesy — not legally required) | +| **CCTV Camera Database** model-enrichment extract v2.26.0 + v2.29.0 (20 CCTV and 15 ALPR camera-model records) | `src/layers/cctv/modelSpecs.js`, `src/layers/alpr/modelSpecs.js` | **CC0-1.0** (public domain dedication) | ✅ (no restrictions) | "Specs: cctv-database.com" (courtesy — not legally required) | ### ⚠️ TeleGeography is bundled but NonCommercial @@ -458,6 +458,17 @@ commercial use with attribution and applicable database share-alike/access obligations; it does not license the application code. Trimmed test-only tile fixtures retain their provenance in `src/data/fixtures/README.md`. +A mapped `model` tag that names datasheet hardware adds a spec line to the +selected card. The specs are 16 CC0-1.0 records from the CCTV Camera Database +model-enrichment extract (v2.29.0): 15 compiled into +`src/layers/alpr/modelSpecs.js`, with the bare product codes mappers tag added +as aliases and the SharpV G3 and SharpX XGA titles naming their variant, plus +the CCTV layer's Bosch MIC-7522-Z30 record. Nothing is fetched at runtime, and +an unrecognised tag is never displayed. The default hourly extract does not +carry `model` yet, so the line appears only with a source that supplies it: an +Overpass-backed source or a custom adapter whose records include the optional +`model` field. + ### CCTV Camera Database (`src/layers/cctv/modelSpecs.js`) The CCTV layer's hardware-model specs are a small extract (v2.26.0, plus the Bosch MIC diff --git a/changelog.d/1360-alpr-model-specs.md b/changelog.d/1360-alpr-model-specs.md new file mode 100644 index 0000000000..a7db9817c5 --- /dev/null +++ b/changelog.d/1360-alpr-model-specs.md @@ -0,0 +1,7 @@ +- Mapped ALPR cameras whose OpenStreetMap `model` tag names known hardware + (Motorola Solutions Vigilant, Genetec AutoVu, Axis, Verkada, Bosch MIC) show + a datasheet spec line on their card, from 16 vendored CCTV Camera Database + records, when their source supplies `model` (an Overpass-backed source or an + integration adapter; the default hourly extract does not yet); unknown, + generation-ambiguous or mis-attributed models show nothing + (bassem chagra, @ch-bas, #1360). diff --git a/changelog.d/1866-no-focus-zoom.md b/changelog.d/1866-no-focus-zoom.md new file mode 100644 index 0000000000..231f5721f4 --- /dev/null +++ b/changelog.d/1866-no-focus-zoom.md @@ -0,0 +1,3 @@ +- Tapping the search box or any other text field on an iPhone no longer leaves + the page zoomed in: the page stays at its own scale and the map does the + zooming (samehkhamis, #1866). diff --git a/changelog.d/1867-start-layers.md b/changelog.d/1867-start-layers.md new file mode 100644 index 0000000000..d617556057 --- /dev/null +++ b/changelog.d/1867-start-layers.md @@ -0,0 +1,4 @@ +- An application can name the layers a bare address starts with + (`startLayers` on `createApplicationControls`; none by default): they turn on + without being saved as the user's own choice, and a link's own layers always + win (samehkhamis, #1867). diff --git a/changelog.d/1869-kit-sweep-final-scan.md b/changelog.d/1869-kit-sweep-final-scan.md new file mode 100644 index 0000000000..bcdfc9d9ff --- /dev/null +++ b/changelog.d/1869-kit-sweep-final-scan.md @@ -0,0 +1,3 @@ +- The view scan now forbids any hand-written button, Material glyph, + checkbox or range in the views, and any control built in script + (manjunath22466, samehkhamis, #1869). diff --git a/changelog.d/1871-street-level-photo-followups.md b/changelog.d/1871-street-level-photo-followups.md new file mode 100644 index 0000000000..e68357f915 --- /dev/null +++ b/changelog.d/1871-street-level-photo-followups.md @@ -0,0 +1,3 @@ +- Street Level's photo viewer settles every open and mount, draws one + viewer at a time and states its view contract (manjunath22466, + samehkhamis, #1871). diff --git a/docs/CURRENT-STATE.md b/docs/CURRENT-STATE.md index ed3531e5cb..6b218b17fc 100644 --- a/docs/CURRENT-STATE.md +++ b/docs/CURRENT-STATE.md @@ -1953,6 +1953,16 @@ The row count explicitly says **nearby**: loaded records can be outside the screen. Cyan camera badges use Manjunath's camera artwork; selection switches to a larger coral badge with corner brackets and an animated tactical card. Numeric mapped bearings draw illustrative 90 m direction wedges (not measured coverage). +A camera whose OSM `model` tag names known hardware (Motorola Solutions Vigilant, +Genetec AutoVu, Axis, Verkada, Bosch MIC; 408 of the 1,567 tagged cameras +in October 2026) gets a `SPEC` line on its card from vendored datasheet records +(`src/layers/alpr/modelSpecs.js`, matched with the CCTV layer's +`createModelSpecLookup`). A `manufacturer` naming another maker rejects the +match, and the raw tag text is never shown. +Unversioned `AutoVu SharpV` and `AutoVu SharpX` tags show no specs; G1/G2 +tags show the G2 (1280x960) record and G3 tags the G3 record. The default +hourly extract has no `model` field yet; an Overpass-backed source or a custom +adapter record's optional `model` fills it. The shared overlay paints gradients for at most 64 nearby cameras, promoting the selected camera; farther cameras keep native Cesium badges without wedges. Native ground-clamped wedges (a ground polyline plus a classification polygon per @@ -6358,8 +6368,9 @@ viewer host and hands back the canvas the panorama is drawn on (a fresh one after a lost context). Each mount and each canvas has a key of its own, so a viewer never draws on another one's elements, and of two viewers mounting at once only the later one is drawn (`photoViewers.js`): the -earlier one's mount closes. Without a subscribed view these photos cannot -open. +earlier one's mount closes. A view may draw at once or later; what it +reads (`mountKey`, `actions.supersede()`) is `ViewerAdapter.subscribeView` +in `registry.js`. Without a subscribed view these photos cannot open. Panoramax (`providers/panoramax/`) is keyless and browser-side: the meta-catalogue `api.panoramax.xyz` (CORS open) federates every instance, and @@ -8869,6 +8880,9 @@ remembers" are different promises: a link restores what its hash carries, and a bare URL starts with the default layers and options (`src/ui/shareRestoration.js` passes `allowLocalState: false`), so clearing the address always resets the view. + A host may name the layers a bare URL starts with (`startLayers` on + `createApplicationControls`, e.g. `['flights', 'satellites']`); they are + restored passively, never written to storage, and a link's own layers win. - **Detection mode/density and scope feather have NO storage key at all.** Their only durable carrier is the URL hash (`dm`/`dd`, `scf`), written on a 500 ms debounce. A same-URL reload therefore keeps them only if that debounce already diff --git a/docs/VUE-MIGRATION.md b/docs/VUE-MIGRATION.md index bbe5450990..aa2909df10 100644 --- a/docs/VUE-MIGRATION.md +++ b/docs/VUE-MIGRATION.md @@ -84,6 +84,21 @@ Home and End), since each of Core's groups keeps its own keyboard policy, and once and asks for a change only when it lands on another option. Every segmented group in Core is a `UiSegmented`; the old `segmentedControl.js` adapter is gone. +No view hand-writes a control the kit has: every button in an SFC outside +the kit is a `UiButton`, `UiCloseButton` or another kit control, every +Material Symbols glyph a `UiIcon`, every checkbox a `UiCheckbox`, every +select a `UiSelect`, and every range a `UiSlider` except the radio +tuner's and the world timeline's, for the reasons given below. No module +outside the kit, and no SFC's script, builds a button, select, field or +Material glyph in script or writes one as markup in a string, apart from +the globe panel's standalone page (`src/tools/globePanel.js`), plain HTML +a host serves with no Vue or kit, whose Expand and Open buttons are +written as markup (`src/ui/kit/viewControls.test.mjs` pins all of it). +The native fields left are the text, number, password and file inputs +and the two text areas (the chat's message box and the scene dialog's +multiline field) the kit has no control for, and the search fields whose +surfaces this document names. The scene dialog's single-line field takes +its type from its caller, which passes text-like types only. `UiButton` adds `pressedClass`, Core's class on a pressed toggle (most use `active`); its pressed classes toggle through `classList`, so a class other code adds (a voice highlight) survives a press. Every pressed toggle (a diff --git a/index.html b/index.html index ded159f2c9..ed18f8e240 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + God's Eye View

', + ]) + assert.equal(rawButtons(markup).length, 0, markup); + + for (const markup of [ + '', + '', + '', + '', + ]) + assert.equal(materialGlyphs(markup).length, 1, markup); + for (const markup of [ + '', + '', + '', + ]) + assert.equal(materialGlyphs(markup).length, 0, markup); + + assert.equal( + nativeInputs( + '', + 'checkbox', + ).length, + 1, + ); + assert.equal( + nativeInputs( + '', + 'range', + ).length, + 1, + ); + assert.equal( + nativeInputs( + '', + 'checkbox', + ).length, + 0, + ); + assert.equal( + nativeInputs( + '', + 'checkbox', + ).length, + 0, + ); + for (const markup of [ + ``, + ``, + ``, + '', + '', + ]) + assert.equal(nativeInputs(markup, 'checkbox').length, 1, markup); + assert.equal( + nativeInputs('', 'checkbox') + .length, + 0, + ); + assert.equal( + materialGlyphs( + ``, + ).length, + 1, + ); +}); + test('the views are read: the scan reaches the views and skips the kit', () => { const files = views.map((view) => view.file); assert.ok(files.includes('src/ui/views/panels/ChatPanel.vue')); @@ -169,3 +302,138 @@ test('no view hand-writes a close button; each is a UiCloseButton', () => { found.push(`${file}: ${markup}`); assert.deepEqual(found, []); }); + +test('every button in the views is a kit button', () => { + const found = []; + for (const { file, source } of views) + for (const markup of rawButtons(source)) found.push(`${file}: ${markup}`); + assert.deepEqual(found, []); +}); + +test('every Material Symbols glyph in the views is a UiIcon', () => { + const found = []; + for (const { file, source } of views) + for (const markup of materialGlyphs(source)) + found.push(`${file}: ${markup}`); + assert.deepEqual(found, []); +}); + +test('every checkbox in the views is a UiCheckbox', () => { + const found = []; + for (const { file, source } of views) + for (const markup of nativeInputs(source, 'checkbox')) + found.push(`${file}: ${markup}`); + assert.deepEqual(found, []); +}); + +test('every range in the views is a UiSlider apart from the two named', () => { + const counts = {}; + for (const { file, source } of views) { + const n = nativeInputs(source, 'range').length; + if (n) counts[file] = n; + } + assert.deepEqual(counts, NATIVE_RANGES); +}); + +// The globe panel's standalone page: plain HTML a host serves, with no Vue +// and no kit, so its two buttons are written as markup. +const STRING_MARKUP_PAGES = new Set(['src/tools/globePanel.js']); + +/** + * Every module under src outside the kit, tests and test support, and every + * SFC's script blocks, as `{ file, source }`. + */ +function scriptSources(directory = SRC_ROOT) { + const found = []; + for (const entry of readdirSync(directory, { withFileTypes: true })) { + const absolute = path.join(directory, entry.name); + const file = path.relative(REPO_ROOT, absolute).split(path.sep).join('/'); + if (entry.isDirectory()) { + if ( + path.relative(KIT_ROOT, absolute) !== '' && + entry.name !== 'testSupport' + ) + found.push(...scriptSources(absolute)); + } else if ( + !entry.isFile() || + /\.test\.(?:js|mjs|ts)$|Fixture\.mjs$/.test(entry.name) + ) { + continue; + } else if (/\.(?:js|mjs|ts)$/.test(entry.name)) { + found.push({ file, source: readFileSync(absolute, 'utf8') }); + } else if (entry.name.endsWith('.vue')) { + const blocks = [ + ...readFileSync(absolute, 'utf8').matchAll( + /]*>([\s\S]*?)<\/script\s*>/g, + ), + ]; + found.push({ file, source: blocks.map((m) => m[1]).join('\n') }); + } + } + return found; +} + +const SCRIPT_CONTROL = + /\bcreateElement(?:NS)?\(\s*(?:[^,)]*,\s*)?['"`](?:button|select|input|textarea)['"`]/gi; +const SCRIPT_GLYPH = + /['"`][^'"`]*\bmaterial-symbols-(?:outlined|rounded|sharp|\$\{)/g; +const STRING_MARKUP = /<(?:button|select|input|textarea)\b/gi; + +/** A source with its comments blanked, line numbers kept. */ +const uncommented = (source) => + source + .replace(/\/\*[\s\S]*?\*\//g, (comment) => comment.replace(/[^\n]/g, ' ')) + .replace(/(^|[^:'"`\\])\/\/[^\n]*/g, '$1'); + +/** Each match in a source, as `file:line: text`. */ +function hits(file, source, pattern) { + return [...source.matchAll(pattern)].map((m) => { + const line = source.slice(0, m.index).split('\n').length; + return `${file}:${line}: ${source.split('\n')[line - 1].trim()}`; + }); +} + +test('no module outside the kit builds a control or Material glyph in script', () => { + const sees = (pattern, text) => [...text.matchAll(pattern)].length > 0; + assert.ok( + sees(SCRIPT_CONTROL, "const b = document.createElement('button');"), + ); + assert.ok(sees(SCRIPT_CONTROL, 'doc.createElement("INPUT")')); + assert.ok( + sees(SCRIPT_CONTROL, "someDocument.createElement(\n 'button',\n);"), + ); + assert.ok(!sees(SCRIPT_CONTROL, "document.createElement('div')")); + assert.ok( + sees(SCRIPT_GLYPH, "span.className = 'material-symbols-outlined';"), + ); + assert.ok(sees(SCRIPT_GLYPH, 'el.className = `material-symbols-${style}`;')); + assert.ok( + !sees(SCRIPT_GLYPH, 'ctx.font = \'24px "Material Symbols Outlined"\';'), + ); + assert.ok(sees(STRING_MARKUP, "host.innerHTML = '';")); + assert.ok( + !sees(STRING_MARKUP, "''".replace('', '')), + ); + + const sources = scriptSources(); + assert.ok( + sources.some(({ file }) => file === 'src/ui/views/panels/ChatPanel.vue'), + ); + const found = []; + for (const { file, source } of sources) { + found.push( + ...hits(file, source, SCRIPT_CONTROL), + ...hits(file, source, SCRIPT_GLYPH), + ); + if (!STRING_MARKUP_PAGES.has(file)) + found.push(...hits(file, uncommented(source), STRING_MARKUP)); + } + assert.deepEqual(found, []); + for (const file of STRING_MARKUP_PAGES) { + const page = sources.find((s) => s.file === file); + assert.ok( + page && hits(file, page.source, STRING_MARKUP).length, + `${file} no longer writes markup`, + ); + } +}); diff --git a/src/ui/shareRestoration.js b/src/ui/shareRestoration.js index 6d93d5061c..0b34ffbd55 100644 --- a/src/ui/shareRestoration.js +++ b/src/ui/shareRestoration.js @@ -167,7 +167,10 @@ export class ShareRestoration { feedback, updateFeedback, applyFollowOffset = null, + startLayers = [], }) { + // The layers a bare address starts with; a link names its own. + this._startLayers = startLayers; Object.assign(this, { viewer, navigation, @@ -421,6 +424,7 @@ export class ShareRestoration { // with the default layers. Saved layer choices never come back on // their own, so clearing the address always resets the view. allowLocalState: false, + startLayerIds: this._initialShareState ? [] : this._startLayers, }); if (this._initialShareSelectionSuperseded) { this._layerStateCoordinator.cancelPendingShareTracking( diff --git a/src/ui/stores/streetLevelPhoto.js b/src/ui/stores/streetLevelPhoto.js index dc0ebffacb..b9498452b3 100644 --- a/src/ui/stores/streetLevelPhoto.js +++ b/src/ui/stores/streetLevelPhoto.js @@ -10,9 +10,12 @@ export const useStreetLevelPhotoStore = defineStore( 'gev-street-level-photo', () => { /** - * `{host, providerId, label, alt, kind, src, fit, canvasKey, dragging, - * prevLabel, prevDisabled, nextLabel, nextDisabled, actions}`, or null - * while no photo viewer is mounted. + * `{host, mountKey, providerId, label, alt, kind, src, fit, canvasKey, + * dragging, prevLabel, prevDisabled, nextLabel, nextDisabled, actions}`, + * or null while no photo viewer is mounted. Of the viewers mounting in + * the host, only the one mounted last (the largest `mountKey`) is + * published; `actions.supersede()` tells the others they are not drawn + * (see `ViewerAdapter.subscribeView` in src/layers/streetLevel/registry.js). */ const photo = shallowRef(null);