Merge origin/main: keep the provider registry, slim it

main grew the Street Level provider registry while this branch removed it
(#982–#985: injected providers, an empty composition, the `r` switch field).
The registry, params, uiState and pick router come back as main has them and
the slimmed layer sits behind the provider contract:

- The core (index.js) drives providers as on main, without surface modes,
  ground casting, FOLLOW, prewarm and nearest-image lookups. A provider's key
  status is asked with a 10 s timeout and asked again on a switch-on while no
  key is known.
- Mapillary is mapillaryProvider.js over the slim coverage, sequences and
  viewer modules, which read the filter and the active flag from the provider
  context.
- The viewer host mounts one provider adapter at a time, no prewarm.
- The panel has a chip per provider again (the pill switches the layer);
  no legend, EXPAND stays the Fullscreen API.
- The contract drops what no provider implements: groundCaster, meshSampler,
  getSurface/setSurface, nearestImage, prewarm, reportError, the legend and
  surface fields of the UI snapshot.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
German KhokhlovandClaude Fable 5.1 committed 2026-10-13 13:24:25 +04:00
commit c29ccd55d6
103 files changed
+5469 -522

No files matched your search

+9 -22
View File
@@ -7,6 +7,9 @@ import { FILTER_DEFAULT } from './policy.js';
export function freshStreet() {
return {
open: false,
providerId: null,
providerName: null,
providerLabel: null,
imageId: null,
position: null,
bearing: null,
@@ -21,7 +24,7 @@ export function freshStreet() {
};
}
/** Coverage bookkeeping, before the first refresh. */
/** A provider's coverage bookkeeping, before the first refresh. */
export function freshCoverage() {
return {
zoom: null,
@@ -34,7 +37,7 @@ export function freshCoverage() {
lastError: null,
/**
* Why tile requests are paused, or null: 'status' until the key status
* answers, 'no-key', 'rejected' (until the layer goes off) or
* answers, 'no-key', 'rejected' (until the provider goes off) or
* 'rate-limited' (until `blockTimer` fires).
*/
blocked: 'status',
@@ -46,7 +49,7 @@ export function freshCoverage() {
};
}
/** Mutable layer state, created once per layer instance. */
/** Mutable core state, created once per layer instance. */
export function createState({ services }) {
return {
services,
@@ -54,10 +57,10 @@ export function createState({ services }) {
enabled: false,
listeners: new Set(),
notify: null,
/** The share link's `mapillary` switch: off draws nothing. */
providerOn: true,
/** Imagery filter, in the stored (relative-days) form. */
/** Shared imagery filter, in the stored (relative-days) form. */
filter: { ...FILTER_DEFAULT },
/** @type {Map<string, {def: object, instance: object, on: boolean, status: object|null}>} */
providers: new Map(),
street: {
host: null,
@@ -66,23 +69,7 @@ export function createState({ services }) {
...freshStreet(),
},
coverage: freshCoverage(),
sequence: {
selectedId: null,
images: [],
collection: null,
loading: false,
/** Why the selected sequence's images could not load, until it goes. */
error: null,
abort: null,
},
marker: { collection: null, billboard: null },
clickHandler: null,
};
}
/** Coverage, cones and lookups run only while the layer and its switch are on. */
export function isActive(state) {
return state.enabled && state.providerOn;
}