diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 491f2468d..ce3563685 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,8 +67,6 @@ jobs: timeout-minutes: 30 env: GEV_REQUIRE_ALLOCATION_GATE: '0' - # Fail on a missed header press unless the panel itself moved. - QA_FAIL_ON_RETRY: '1' steps: - name: Check out source uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 @@ -104,10 +102,6 @@ jobs: - name: Street Level gate with Mapillary fixtures run: npm run qa:street-level:fixtures -- --strict --url http://localhost:4173 - - name: Portable panel gate - if: success() || failure() - run: npm run qa:panel-resize -- --url http://localhost:4173 - - name: Preview server log if: failure() run: cat preview.log diff --git a/.gitignore b/.gitignore index d2f0107c0..11e081e7d 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,10 @@ output/ .gev-cache/ # Browser QA gate evidence (screenshots, console and network dumps). qa-artifacts/ +# Playwright MCP session logs: browser consoles can carry tokens in URLs. +.playwright-mcp/ +# Local Claude Code settings and preview configs. +.claude/ .DS_Store .gstack/ 3d-models/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 98d32365f..0ad3a7368 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -317,9 +317,8 @@ [NotProniss](https://github.com/NotProniss) (#1084). - Street Level: Panoramax is the fourth provider, keyless. Light its chip - (orange; off by default, one provider at a time): from orbit dots show - where the federated commons has pictures, and below about 60 km its - sequences draw as lines from `api.panoramax.xyz` vector tiles. A click on a + (orange; off by default, one provider at a time): below about 60 km the + federated commons' sequences draw as lines from `api.panoramax.xyz` vector tiles. A click on a line opens that sequence's picture nearest the click without moving the camera, flat or 360°, with cones along the sequence around it and ‹ › / ← → following the picture's own links. The 360° and since filters apply, @@ -377,10 +376,10 @@ Maps JavaScript API) and click a street, or press OPEN STREET VIEW, to open Google's own panorama in the panel, with its arrows, the address and month in the caption, a link - to Google Maps and FOLLOW. Share links carry it in the provider switches + to Google Maps. Share links carry it in the provider switches (`r.google-1`). One provider is lit at a time (lighting one switches the other off), Mapillary by default since it is free. Street View's panoramas - are all 360°, so the IMAGERY and SINCE filters and the legend apply to + are all 360°, so the IMAGERY and SINCE filters apply to Mapillary only and hide while GOOGLE STREET VIEW is lit; its globe marker is a Google-blue view cone. @@ -419,21 +418,16 @@ proposed diagnosis in #927, and [kvnloo](https://github.com/kvnloo) for identifying the repair race. Windows/Claude Desktop Cowork confirmation remains outstanding. -- Street Level: a street-level imagery layer modelled on the iD editor's photo - overlay, with Mapillary as its first provider (free client token, CC BY-SA 4.0 - imagery). One right-rail panel holds a chip per provider, shared 360°/flat and - captured-since filters, and an embedded viewer with EXPAND, FIT/FILL and - FOLLOW (Google 3D only). Coverage lines and image cones are drawn from orbit - down to a single street; on Google 3D they sit on the bare earth, refined - against the rendered mesh near the camera, so trees and buildings hide them. - Share links carry the provider switches, the filters and the panel's collapsed - state. A server proxy caches Mapillary coverage tiles (24 h, 1 GiB on disk), - refuses cross-site requests, rate-limits per IP and backs off when Mapillary - rejects the token or rate-limits. - -- The CCTV and Street Level panels are portable: drag the header to float the - panel, resize it from any edge or corner, and double-click the header to dock - it again. The position persists across reloads. +- Street Level: street-level imagery from providers, Mapillary first (free + client token, CC BY-SA 4.0). A right-rail panel holds a chip per provider, + 360°/flat and captured-since filters and an embedded viewer with EXPAND and + FIT/FILL. Coverage lines (below 60 km) and image cones drape on terrain and + Google 3D tiles; opening a photo frames it with one camera flight. Share + links carry the provider switches, the filters and the panel's collapsed + state. A server proxy adds the token to Mapillary coverage tiles, trims and + caches them for 24 h, refuses cross-site requests and redirects, and limits + load per IP and upstream. The panel reads KEY REQUIRED without a token and + KEY REJECTED when Mapillary refuses it. - Add Norway's city bikes to the Bike Share layer: Oslo, Bergen and Trondheim Bysykkel (Urban Sharing), Kolumbus Bysykkel in Stavanger and diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ba0d38768..442b9c1bf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,9 +54,8 @@ head -40 scripts/qa-radio.mjs # what this runnable gate proves and how to run i Runnable gate entrypoints document what they assert and how to invoke them. Most need a dev server; some also need a specific provider key or port. Follow the entrypoint's header rather than assuming every matching file accepts the -same arguments. Five have an `npm run` alias: `qa:map-source-tray`, -`qa:panel-resize`, `qa:street-level`, `qa:street-level:fixtures` and -`qa:transit`. +same arguments. Four have an `npm run` alias: `qa:map-source-tray`, +`qa:street-level`, `qa:street-level:fixtures` and `qa:transit`. If you aren't sure which gate covers your change, search `docs/CURRENT-STATE.md` for the feature: it names the gate for many of them, and it's the authoritative @@ -66,11 +65,10 @@ gate for the feature you changed. > **CI covers only two of these for you.** The workflow runs the setup policy > checks, the formatting and package-boundary checks, the unit suite and the -> production build, plus a Windows onboarding job, and against the built preview -> it runs `qa:street-level:fixtures` and `qa:panel-resize`. It does not run -> `npm run test:track` or any other `qa-*.mjs` gate — those need a live dev -> server and a browser. Include the applicable local run in your PR's -> validation evidence. +> production build, plus a Windows onboarding job. It runs neither +> `npm run test:track` nor any `qa-*.mjs` gate except the Street Level fixture +> gate (`street-level-browser` job) — they need a live dev server and a +> browser. Include the applicable local run in your PR's validation evidence. ## Share-link layer tokens diff --git a/DATA_SOURCES.md b/DATA_SOURCES.md index c99ec28d1..659171cee 100644 --- a/DATA_SOURCES.md +++ b/DATA_SOURCES.md @@ -20,10 +20,10 @@ How to read this: | **NOAA nowCOAST observed weather** (`nowcoast.noaa.gov/geoserver/observations/{weather_radar,satellite}/ows`, WMS 1.1.1) | Rain radar (MRMS base reflectivity, contiguous US, about 4-minute updates) and Satellite clouds (GOES-19/18 Band 14 regional infrared, about 5-minute updates; global infrared mosaic, hourly). Keyless; layer metadata refreshed every 2 minutes, exact-time images cached for up to 24 hours | [NOAA disclaimer](https://oceanservice.noaa.gov/disclaimer.html) | "NOAA nowCOAST · NWS/OAR MRMS radar; NESDIS GOES and global satellite partners" | | **NOAA nowCOAST lightning density** (`nowcoast.noaa.gov/geoserver/observations/lightning_detection/ows`) | Lightning density: 15-minute accumulated strike density on an approximately 8 km grid, Americas and Pacific. Keyless; layer metadata refreshed every 10 minutes, exact-time images cached for up to 24 hours | NOAA Level-5 derived product from Vaisala NLDN/GLD360; the [product description](https://ocean.weather.gov/lightning/lightning_pdd.php) permits public distribution of this density product, not of raw Vaisala detections | "NOAA/NWS nowCOAST; derived from Vaisala NLDN/GLD360" | | **NOAA NHC / CPHC advisories** (`www.nhc.noaa.gov/CurrentStorms.json` + the `mapservices.weather.noaa.gov` tropical weather summary MapServer) | Cyclone advisories: storm positions, forecast tracks, points and cones for the Atlantic and eastern/central North Pacific. Keyless through `/api/cyclones`; cached for 5 minutes | [NWS public-data terms](https://www.weather.gov/disclaimer); no endorsement implied | "NOAA/NWS NHC / CPHC" | -| **Mapillary** (vector tiles, Graph API, MapillaryJS) | Street Level: coverage lines, image cones and the embedded viewer. Coverage tiles cached for 24 h | Imagery [CC BY-SA 4.0](https://www.mapillary.com/terms); API under the Mapillary terms with a client token | "© Mapillary contributors, CC BY-SA 4.0", shown on the globe while the provider is on | +| **Mapillary** (vector tiles, Graph API, MapillaryJS) | Street Level: coverage lines, image cones and the embedded viewer. Coverage tiles kept in server memory for 24 h | Imagery [CC BY-SA 4.0](https://www.mapillary.com/terms); API under the Mapillary terms with a client token | "© Mapillary contributors, CC BY-SA 4.0", shown on the globe while the provider is on | | **Google Street View** (Maps JavaScript API) | Street Level, on the Google 3D map only (Google's terms): Google's panorama viewer and nearest-panorama lookups; panorama dates and addresses kept for the session only | Google Maps Platform ToS (your own key + billing; every panorama load is billed) | "Street View imagery © Google" on the globe while the provider is on, and Google's logo and terms in the viewer | | **KartaView** (`api.kartaview.org` coverage tiles and photo API, `cdn.kartaview.org` image proxy, `storage*.openstreetcam.org` photos) | Street Level: coverage lines (z13–14 JSON tiles; with the imagery filter on, KartaView's filtered PNG tiles as a mask), nearest-photo lookups, the photo's sequence and the photo itself, fetched by the browser. Keyless; nothing cached beyond the session | Imagery [CC BY-SA 4.0](https://kartaview.org/terms) (KartaView terms §4); the public API needs no token | "© KartaView contributors, CC BY-SA 4.0", shown on the globe while the provider is on | -| **Panoramax** (`api.panoramax.xyz` meta-catalogue: vector tiles and STAC search; pictures from the federated instance holding each one, e.g. `panoramax.openstreetmap.fr`, `panoramax.ign.fr`) | Street Level: coverage lines and density points, nearest-picture lookups, a sequence's pictures as cones, and the picture itself, fetched by the browser. Keyless; tiles cached by the browser for an hour (the API's own header) | Per picture: mostly [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/), IGN's [Licence Ouverte 2.0](https://www.etalab.gouv.fr/licence-ouverte-open-licence/); the API needs no token | "© Panoramax contributors, licence per picture" on the globe while the provider is on; the caption names each picture's author and licence | +| **Panoramax** (`api.panoramax.xyz` meta-catalogue: vector tiles and STAC search; pictures from the federated instance holding each one, e.g. `panoramax.openstreetmap.fr`, `panoramax.ign.fr`) | Street Level: coverage lines, nearest-picture lookups, a sequence's pictures as cones, and the picture itself, fetched by the browser. Keyless; tiles cached by the browser for an hour (the API's own header) | Per picture: mostly [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/), IGN's [Licence Ouverte 2.0](https://www.etalab.gouv.fr/licence-ouverte-open-licence/); the API needs no token | "© Panoramax contributors, licence per picture" on the globe while the provider is on; the caption names each picture's author and licence | | **OpenStreetMap** | Map and place data (roads, military areas and names, ALPR, place search, outlines); via vector tiles, hourly ALPR extract, bundled data, Nominatim and optional self-configured Overpass | [ODbL 1.0](https://opendatacommons.org/licenses/odbl/1-0/) | © OpenStreetMap contributors | | **Google Map Tiles API** (Photorealistic 3D Tiles) + Places/Geocoding | The 3D globe, voice scene context, and on-demand nearby installation search | Google Maps Platform ToS (proprietary, your own key + billing) | "Google" / "Google Maps" logo — **shown in-app**, required | | **OpenSky Network** | Primary worldwide live-flight snapshot | Non-commercial research/education license | Schäfer et al., _"Bringing Up OpenSky"_, IPSN 2014 + opensky-network.org | diff --git a/README.md b/README.md index 3b005c8dc..affe39fa3 100644 --- a/README.md +++ b/README.md @@ -383,7 +383,7 @@ Twenty layers and map sources. **Eighteen have a keyless path.** Some offer addi | 🚗 **Traffic** | Simulated vehicles on OSM roads. With TomTom, live flow speeds drive the simulation and congestion colors below ~8 km; individual vehicle positions are not live observations | TomTom + OSM | 🟢 simulation · 🟡 live flow speeds | | 📹 **CCTV Mesh** | ~4,000 public cameras (shared cap) projected _into_ the 3D space — Austin · Texas (TxDOT) · California (Caltrans) · London (TfL) · Ontario (511) · Finland (Fintraffic) · British Columbia (DriveBC) · Estonia (Tallinn, Tarktee) · Delaware (DelDOT live video) · New South Wales (Live Traffic NSW) · Calgary · Norway (Statens vegvesen) · Toronto · King County (WA) · Washington (WSDOT) · Catalonia (Servei Català de Trànsit), plus opt-in New York City (NYC DOT TMC, needs your own NYC DOT agreement), opt-in Lithuania (Via Lietuva / Eismoinfo, photo licence unconfirmed) and opt-in Florida (FL511, individual personal use only; other use needs FDOT's written consent). Positions are published; poses are estimated priors **you calibrate by dragging a gizmo on the camera itself** | City APIs | 🟢 | | 📷 **Mapped ALPR Cameras** | License-plate-reader camera locations tagged by OpenStreetMap contributors, loaded one city-sized view at a time, with **SHOW NEAREST**. Locations and tags only: no plate data, no video | OpenStreetMap (incl. DeFlock mapping) | 🟢 | -| 📷 **Street Level** | Street-level photos behind one panel, one chip per provider: coverage on the streets, image cones, an embedded viewer and **FOLLOW**. Mapillary, Google Street View, KartaView and Panoramax | Mapillary · Google · KartaView · Panoramax | 🟢 KartaView, Panoramax · 🟡 Mapillary token · 🔴 Google Maps key | +| 📷 **Street Level** | Street-level photos behind one panel, one chip per provider: coverage on the streets, image cones, an embedded viewer with full-screen **EXPAND**. Mapillary, Google Street View, KartaView and Panoramax | Mapillary · Google · KartaView · Panoramax | 🟢 KartaView, Panoramax · 🟡 Mapillary token · 🔴 Google Maps key | | 📻 **Radio** | Geolocated world radio with an **analog tuner** — drag the needle across up to 750 stations and the globe flies to each broadcaster | Radio Browser / broadcasters | 🟢 | | 🚌 **Transit** | Live buses, trams, metros, trains and ferries with delayed playback between reports, selected-vehicle trails, and mode-coloured DETECT labels — Boston, Austin, Minneapolis, Helsinki, the Netherlands, Norway, South East Queensland, and nine in Ontario: Toronto (surface vehicles; the subway publishes no positions), Mississauga, Hamilton, Durham Region, York Region, Guelph, Burlington, Barrie and Kingston | Operator GTFS-Realtime feeds | 🟢 | | 🚲 **Bikeshare** | Live station availability | GBFS | 🟢 | @@ -425,9 +425,9 @@ _The Space Missions layer replaying a Falcon 9 ascent — labeled `RECONSTRUCTED **Setup.** At [mapillary.com/dashboard/developers](https://www.mapillary.com/dashboard/developers), register an application with **Read** access and copy its **Client Token** (`MLY|…`). Paste it into **POWER UP → Mapillary**, or set `MAPILLARY_CLIENT_TOKEN` in `.env` and restart. Without it the panel reads **KEY REQUIRED**. **Google Street View** uses `GOOGLE_MAPS_API_KEY` with the **Maps JavaScript API** enabled for it in Google Cloud; its chip starts off, since every panorama is billed to the key. **KartaView** and **Panoramax** need nothing: their public APIs are keyless. -**Use.** Turn on **Street Level** under DATA LAYERS → Cameras, or with the pill in the STREET LEVEL panel header. Each provider has a chip in its own colour (Mapillary green), and one is lit at a time: lighting one switches the others off. Mapillary, which is free, is lit by default. The **IMAGERY** (ALL / 360° / FLAT) and **SINCE** filters apply to Mapillary, KartaView and Panoramax; Street View panoramas are all 360°, so with Street View lit the filters and legend are hidden. Click a coverage line for its image cones and a cone to open the photo. Light **KARTAVIEW** (purple) and zoom in below about 6 km: its lines are the streets KartaView has photos of, and a click on one opens the photo nearest the click, flat or 360° (drag to look around), with cones along its drive; **‹ ›** or ← → step through the drive (Shift+← →, ↑ ↓ and + − look around a 360° photo; pinch zooms on a phone). Photos KartaView has archived are skipped, and where all are archived the panel says so. For KartaView, **SINCE** goes by upload date, as KartaView's own map does (it can filter by nothing else), and the panel notes it under the slider; KartaView filters its lines on its own server, and a filtered area KartaView has not drawn before can take several seconds, and the unfiltered lines show meanwhile. Light **PANORAMAX** (orange) for the open, federated commons (strongest in France and Belgium): from orbit its dots show where it has pictures, and below about 60 km its lines are sequences. A click on a line opens that sequence's picture nearest the click without moving the camera, flat or 360°, with cones along the sequence around it; **‹ ›** or ← → step through it, and both filters apply. Its caption names the picture's authors (or the instance holding it) and licence (mostly CC BY-SA 4.0; pictures on the IGN instance are Licence Ouverte 2.0). On the **Google 3D** map (Google's terms keep Street View off other maps, where it does not appear), light **GOOGLE STREET VIEW** and click a street from below 3 km, or press **OPEN STREET VIEW** for the view centre, to open Google's panorama there; step along its arrows. Above the photo: **EXPAND**, **FIT / FILL** (Mapillary, and flat KartaView and Panoramax photos), and **FOLLOW** (the globe camera follows the photo's view; Google 3D map only). The caption links to the image on the provider's site, and the globe credits each provider that is on ("© Mapillary contributors, CC BY-SA 4.0", "Street View imagery © Google", "© KartaView contributors, CC BY-SA 4.0", "© Panoramax contributors, licence per picture"). KartaView's own photo pages fail for signed-out visitors, so its link opens the full-size photo. +**Use.** Turn on **Street Level** under DATA LAYERS → Cameras, or with the pill in the STREET LEVEL panel header. Each provider has a chip in its own colour (Mapillary green), and one is lit at a time: lighting one switches the others off. Mapillary, which is free, is lit by default. Zoom in to street level (below 60 km) for the coverage lines; from orbit the panel says to zoom in. The **IMAGERY** (ALL / 360° / FLAT) and **SINCE** filters apply to Mapillary, KartaView and Panoramax; Street View panoramas are all 360°, so with Street View lit the filters are hidden. Click a coverage line for its image cones and a cone to open the photo. Light **KARTAVIEW** (purple) and zoom in below about 6 km: its lines are the streets KartaView has photos of, and a click on one opens the photo nearest the click, flat or 360° (drag to look around), with cones along its drive; **‹ ›** or ← → step through the drive (Shift+← →, ↑ ↓ and + − look around a 360° photo; pinch zooms on a phone). Photos KartaView has archived are skipped, and where all are archived the panel says so. For KartaView, **SINCE** goes by upload date, as KartaView's own map does (it can filter by nothing else), and the panel notes it under the slider; KartaView filters its lines on its own server, and a filtered area KartaView has not drawn before can take several seconds. Light **PANORAMAX** (orange) for the open, federated commons (strongest in France and Belgium): below about 60 km its lines are sequences. A click on a line opens that sequence's picture nearest the click without moving the camera, flat or 360°, with cones along the sequence around it; **‹ ›** or ← → step through it, and both filters apply. Its caption names the picture's authors (or the instance holding it) and licence (mostly CC BY-SA 4.0; pictures on the IGN instance are Licence Ouverte 2.0). On the **Google 3D** map (Google's terms keep Street View off other maps, where it does not appear), light **GOOGLE STREET VIEW** and click a street from below 3 km, or press **OPEN STREET VIEW** for the view centre, to open Google's panorama there; step along its arrows. Above the photo: **EXPAND** (full screen; Esc leaves) and **FIT / FILL** (Mapillary, and flat KartaView and Panoramax photos). The caption links to the image on the provider's site, and the globe credits each provider that is on ("© Mapillary contributors, CC BY-SA 4.0", "Street View imagery © Google", "© KartaView contributors, CC BY-SA 4.0", "© Panoramax contributors, licence per picture"). KartaView's own photo pages fail for signed-out visitors, so its link opens the full-size photo. -Drag the panel header to float the panel, and resize it from any edge. Double-click the header or collapse it to put it back in the rail. Share links carry the provider switches and filters (`0.m.0` Mapillary off, `0.m.0_0.r.google-1` Street View on, `0.m.0_0.r.google-0*kartaview-1*panoramax-0` KartaView on and `0.m.0_0.r.google-0*kartaview-0*panoramax-1` Panoramax on, as the app writes them (`0.m.0_0.r.kartaview-1` and `0.m.0_0.r.panoramax-1` work too; a link that leaves out `m` keeps Mapillary, the default, lit), `0.p.p` panoramas only, `0.s.365` the last year). To add a provider, implement the contract in `src/layers/streetLevel/registry.js` and register it in `src/app/layers/streetLevel.js`. +Share links carry the provider switches and filters (`0.m.0` Mapillary off, `0.m.0_0.r.google-1` Street View on, `0.m.0_0.r.google-0*kartaview-1*panoramax-0` KartaView on and `0.m.0_0.r.google-0*kartaview-0*panoramax-1` Panoramax on, as the app writes them (`0.m.0_0.r.kartaview-1` and `0.m.0_0.r.panoramax-1` work too; a link that leaves out `m` keeps Mapillary, the default, lit), `0.p.p` panoramas only, `0.s.365` the last year). To add a provider, implement the contract in `src/layers/streetLevel/registry.js` and register it in `src/app/layers/streetLevel.js`. ## 🎖️ Field Missions diff --git a/SECURITY.md b/SECURITY.md index b694d8dcd..30203ed94 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -29,7 +29,7 @@ These are designed to be used directly in the browser (like a Mapbox public toke 1. **Google Maps API key** — loads Photorealistic 3D Tiles directly and powers Street View (Maps JavaScript API; add it to the key's API restrictions). **Restrict it** (HTTP referrer + API restriction to the required Google APIs) in the Google Cloud Console. An unrestricted key in a public deployment can be abused and billed to you. Restrict it to the **Map Tiles API and Maps JavaScript API only**: a referrer restriction applies to the Maps JavaScript API and the client SDKs, not to the web services, so a key carrying Geocoding under one is refused with `API keys with referer restrictions cannot be used with this API`. Search does not need it — geocoding goes through the server proxies above (#363). 2. **Cesium ion token** (`CESIUM_ION_TOKEN`, optional — for ion-hosted Google Photorealistic 3D Tiles, Bing world imagery, and world terrain) — used as `Cesium.Ion.defaultAccessToken` client-side. Use a public **`assets:read`** token with **URL restrictions** for any hosted deployment. The Community plan has eligibility and usage limits; a public token is not a secret, but it can still consume the account's quota. -3. **Mapillary client token** (`MAPILLARY_CLIENT_TOKEN`, optional, Street Level) — used by the MapillaryJS viewer and Graph API lookups in the browser, and by the server's coverage-tile proxy. Mapillary client tokens are meant for browser use. +3. **Mapillary client token** (`MAPILLARY_CLIENT_TOKEN`, optional, Street Level) — used by the MapillaryJS viewer and Graph API lookups in the browser, and by the server's coverage-tile proxy, which sends it only to `tiles.mapillary.com` over HTTPS (an upstream redirect is refused and answered 502, never followed) and caches tiles in memory only. Mapillary client tokens are meant for browser use. > The explicit browser `define` block in `build/vite.js` controls exactly what reaches the client: only these three keys. Everything else stays server-side. diff --git a/changelog.d/974-street-level-slim.md b/changelog.d/974-street-level-slim.md new file mode 100644 index 000000000..8bc2b5346 --- /dev/null +++ b/changelog.d/974-street-level-slim.md @@ -0,0 +1,6 @@ +- Street Level is rebuilt around one small provider registry: Mapillary, + KartaView, Panoramax and Google Street View share one coverage drawer and + one photo viewer, one source lit at a time. Floating and docked panels, + FOLLOW, surface modes, the legend and the Mapillary proxy's disk cache are + gone; `.gev-cache/mapillary/` from earlier runs is no longer read and can be + deleted (gekh, #974). diff --git a/docs/CODE-BOUNDARIES.md b/docs/CODE-BOUNDARIES.md index 19a5ee372..eb393a2da 100644 --- a/docs/CODE-BOUNDARIES.md +++ b/docs/CODE-BOUNDARIES.md @@ -356,8 +356,8 @@ drag or final change. Feature adapters own data mapping and service subscription generic modules own DOM/listeners/timers and release them in `destroy()`. Keep persistence with panel chrome: collapse uses -`godsEyeView.v6.panelCollapsed.`, position uses -`godsEyeView.v8.panelPos.`, and share state uses the registered panel id. +`godsEyeView.v6.panelCollapsed.`, positions are +not stored (`godsEyeView.v8.panelPos.` stays reserved), and share state uses the registered panel id. Do not rename existing ids or reset persistence versions when adding a body. The WEATHER adapter is `src/ui/weatherPanel.js`; its observed-history selection remains transient. diff --git a/docs/CURRENT-STATE.md b/docs/CURRENT-STATE.md index 910d9e64b..42f338ce5 100644 --- a/docs/CURRENT-STATE.md +++ b/docs/CURRENT-STATE.md @@ -651,7 +651,7 @@ The UI facade composes separate owners for navigation authority, share restorati visual settings and panel chrome. Navigation owns request generations and follow handoff; restoration owns its coordinator, deferred notices, gestures and timer; visual settings own style/detection overrides and sensor cleanup; panel chrome -owns disclosure, docking and Cockpit panel snapshots. Each takes explicit +owns disclosure and Cockpit panel snapshots. Each takes explicit operations and reads instead of the complete shell. Existing controls, share formats and one-application-per-page behavior are preserved. @@ -981,10 +981,9 @@ start with current state, isolate listener failures and stop on disposal. The standalone entry composes the UI with the application's existing layer, terrain, navigation and rendering operations. The shell receives those instances -and assembles the controls. Panel layout scheduling, position preferences and -active drags, loading notices, recording presentation and DOM lookup have focused +and assembles the controls. Panel layout scheduling, loading notices, recording presentation and DOM lookup have focused owners. Disposal revokes queued presentation and listeners before asynchronous -Context restoration, cancels an unfinished drag without saving it, restores the +Context restoration, restores the recording HUD and releases status decoration without replacing accessible text. The ordinary control snapshot includes the current 3D model toggle and mode. @@ -3468,7 +3467,7 @@ its criteria cannot be silently ignored. | Dams ▰ | OpenInfraMap/OSM extract (bundled) | `src/data/localLayers.js` | — | static | | Submarine Cables ◠ | TeleGeography public map (bundled) | `src/data/telegeographySubmarineCables.js` | — | static | | FIRMS Active Fires ▲ | NASA FIRMS live (VIIRS ×3 NRT + MODIS NRT, trailing 24h) | `src/data/firmsHeatmap.js` | `/api/firms` (`FIRMS_MAP_KEY`) | 10 min (proxy TTL 30 min) | -| Street Level 📷 | Street-level imagery; Mapillary is the first provider (vector tiles, Graph API, MapillaryJS) | `src/layers/streetLevel/` via `src/app/layers/streetLevel.js` | `/api/mapillary/status`, `/api/mapillary/tiles/coverage/{z}/{x}/{y}` (`MAPILLARY_CLIENT_TOKEN`) | camera-driven (320 ms debounce, ≤9 tiles, cached 24 h) | +| Street Level 📷 | Mapillary street-level imagery (vector tiles, Graph API, MapillaryJS) | `src/layers/streetLevel/` via `src/app/layers/streetLevel.js` | `/api/mapillary/status`, `/api/mapillary/tiles/coverage/{z}/{x}/{y}` (`MAPILLARY_CLIENT_TOKEN`) | camera-driven (320 ms debounce, ≤9 tiles, server memory cache 24 h) | | Wind 🌬 | NOAA GFS 10 m wind (keyless, 0.25°→1° grid; animated particles) | `src/data/wind.js` | `/api/wind` | 1 h (forecast cycle) | | GNSS Integrity 📡 (`gnss-integrity`) | adsb.lol point snapshot, low navigation accuracy binned per 0.5° cell (GEV NIC/NACp threshold + gpsjam.org formula and bands, keyless, ODbL) | `src/layers/gnss/` via `src/app/layers/gnss.js` | `/api/gnss-integrity` | camera-driven (600 ms debounce, minimum 2.5 s between reads) + 60s poll (server cache 60 s; 30 min rolling window) | | Fire Perimeters 🔥 | NIFC WFIGS current interagency perimeters (keyless, paged past the 2000-record cap); InciWeb catalog + incident page origin and update time checks for verified incident-page links | `src/layers/perimeters/` via `src/app/layers/perimeters.js` | `/api/fire-perimeters` + `/api/fire-perimeters/inciweb/*` | 5 min (server caches: catalog 1 h; publication 30 min) | @@ -3500,8 +3499,8 @@ by `scripts/qa-emergency-squawk.mjs`. Both accept `--timeout-ms` for slow boot. Fire Perimeters uses capped, timed server reads with stale-on-error caching and a per-client limit. Unchanged snapshots retain geometry; link checks cancel on disable or selection change, and the row legend shows reported containment. -Street Level is a collapsible right-rail panel (`#street-level-panel`, layer -token `0`, option owner `street-level`, panel `ui` token `t`) that starts +Street Level is a docked, collapsible right-rail panel (`#street-level-panel`, +layer token `0`, option owner `street-level`, panel `ui` token `t`) that starts collapsed. It opens itself only when the user, voice or a tool switches the layer on or a photo opens, never on a restore, and those opens are not stored. Like the iD editor's photo overlay, it has one chip per registered provider, @@ -3513,31 +3512,30 @@ sequence is GEV cyan. Share options: `m` (Mapillary), `r` (the other providers' e.g. `google-1` for Street View), `p` (`a`/`p`/`f` panoramas), `s` (since, days). Mapillary, Google Street View, KartaView and Panoramax are registered. Without `MAPILLARY_CLIENT_TOKEN` the panel reads KEY REQUIRED and the controls are -disabled. With it, coverage draws as z0–5 overview points from orbit and z11–14 -sequence lines below 60 km; the proxy strips the unused `image` layer from z14 +disabled. With it, coverage draws as z11–14 sequence lines below 60 km; the proxy strips the unused `image` layer from z14 tiles (12 MB → ~80 KB) and shares one upstream fetch between concurrent requests for a tile. -Mapillary coverage ranks unique tile addresses before applying the 16-tile -overview budget. Overlapping dateline halves in a polar view therefore do not -waste overview slots on the same tile; loading already skips duplicate keys. +Coverage is z11–14 sequence lines below 60 km; above that nothing is drawn and +the panel says to zoom in. Tiles come from the visible ground within range of +the camera, nearest first, at most 9 (the halves of a view across +the date line count a shared tile once). Lines are draped +`GroundPolylinePrimitive`s (`ClassificationType.BOTH`), so they follow terrain +and Google 3D tiles alike; cones and the photo marker are ground-clamped +billboards with a horizon cull. Without `MAPILLARY_CLIENT_TOKEN` the panel +reads KEY REQUIRED, says which key to add and disables the filters; a rejected +key reads KEY REJECTED and stops tile requests until the layer goes off; a 429 +pauses them for its Retry-After. -On Google 3D (`photoreal`) at street zoom (in below 1,400 m above ground, out -above 1,800 m) the surface mode switches from `draped` to `terrain`: draped -lines land on roofs and tree tops, so `groundCast.js` instead places lines, -cones and the marker 2 m above the bare earth from `/api/terrain/heights`, and -the mesh hides what is behind buildings and trees. A tile is drawn draped until -its heights arrive; a geoid fallback leaves it draped. Within 900 m of the -camera, `meshSampler.js` samples the rendered surface (`scene.sampleHeight`, -~11 m cells, nearest first, 6 ms idle budget) so lines also follow trenches, -steep streets and roads under trees. It uses the mesh floor's rules (the -visible tileset has finished streaming, a real bare-earth prior, the shared -mesh window) and probes a cell again once the camera is half as far from it, -down to 40 m, so coarse early samples are replaced as finer tiles load. A -failed probe keeps the last good sample and distance and is retried after the -miss cooldown. Roads on elevated decks are still drawn at -ground level. Framing a photo ignores mesh samples far below the bare earth -(unloaded tiles). +The server proxy (`server/providers/mapillary.js`) adds the token to +coverage-tile requests (the browser holds it too, for MapillaryJS and the Graph +API), serves only z11–14 coverage, refuses upstream redirects, strips the +unused `image` layer, shares one fetch per tile, runs at most six at once +(cancelling those every client has left) and keeps tiles in memory for 24 h +(a body too big to be a trimmed tile is served but not kept). While Mapillary +rate-limits, the proxy answers 429 itself until the Retry-After (seconds or an +HTTP date, at most 10 minutes) is over, so the rest of a view does not go on +asking. The header pill is the layer switch. Lighting a chip swaps the source; clicking the lit chip turns the layer off. A chip without a usable key @@ -3548,19 +3546,18 @@ their keys but a switched-off one would draw with a key already set (no Mapillary token, Street View on Google 3D with a Google key), the layer reports it (`keyAlternatives`), and the panel's KEY REQUIRED, its coverage line and the layer row's tooltip say to light it. The -viewer sits under the header with EXPAND, FIT/FILL, FOLLOW and close above the -image. FOLLOW needs the Google 3D map stack (`attachMapStackController`) and -stops when the stack changes. Camera moves go through the application's -navigation (`attachNavigation`), which releases aircraft and satellite tracking -and is refused in the cockpit: turning FOLLOW on claims the camera at once, and -FOLLOW stops when another feature takes it; a photo takes a deferred ticket -when it starts opening and frames only if nothing newer took the camera while -it loaded. SINCE is a stepped slider whose readout names the -cut-off date. The panel is portable (`street-level-panel` spec, minimum -320 × 280, `dockOnCollapse`): a floating window gives spare height to the -viewer, and collapsing it, double-clicking the header or SHRINK after EXPAND -docks it. At phone width (≤720 px) the viewer height is derived from the rail -band so the whole photo fits. +viewer sits under the header with EXPAND, FIT/FILL and close above the +image. SINCE is a stepped slider whose readout names the cut-off date. + +MapillaryJS loads on the first photo. Opening one frames it with a single +camera flight through the application's deferred navigation (`begin` / +`reassert`): it releases tracking, is refused in the cockpit, and is skipped +if newer navigation took the camera while the photo loaded; closing the photo +cancels it. EXPAND is the browser's Fullscreen API on the viewer element; on +iPhone, which has no element fullscreen, the viewer opens as a top-layer +popover instead (hidden where neither API exists). Clean View, recording and +the cockpit take an expanded photo out of full screen. At phone width the +viewer height comes from the rail band so the whole photo fits. Providers implement the contract in `src/layers/streetLevel/registry.js`. The core routes clicks by pick prefix, swaps viewer adapters in the one host, @@ -3569,9 +3566,10 @@ add a provider: implement the definition, register it in `src/app/layers/streetLevel.js` and add its modules to `scripts/package-boundaries.json`; its share switch travels in `r` by id. A provider with line coverage builds it on `lineCoverage.js` (camera-driven -XYZ tiles, draped or cast to bare earth, selection recolouring) and its cones +XYZ tiles near the ground, draped, the selected sequence drawn again over +them) and its cones on `sequenceCones.js`, passing its tile fetch, zoom ladder, colours and pick -prefixes; Mapillary's `coverage.js` and `sequences.js` are such wrappers. With providers on different keys the +prefixes; Mapillary, KartaView and Panoramax all do. With providers on different keys the layer's `requiresKeyId` is null and each chip reports its own key. Google Street View (`providers/google/`) runs on the Maps JavaScript API with @@ -3580,7 +3578,7 @@ on first use (`mapsLoader.js`, CSP `script-src https://maps.googleapis.com`). Its chip starts off (`defaultOn: false`; a link without its switch keeps it off) because every panorama load is billed to the key. Google's terms forbid Street View beside non-Google maps, so the provider declares `requiresMapStack: 'photoreal'`: -off Google 3D it does not appear at all (no chip, legend swatch, globe +off Google 3D it does not appear at all (no chip, globe credit, layer source or button, and Google's script is not loaded), lookups and opens skip it, and leaving Google 3D closes its panorama; the share option keeps the user's choice for when Google 3D returns. Google offers no coverage layer @@ -3602,9 +3600,8 @@ marker is a Google-blue view cone (`marker: {kind: 'view-cone'}`) in place of GEV's amber pin. Its panoramas are all 360° and it draws no coverage, so it declares `filters: []` (a provider's `filters` default to both `pano` and `since`): lookups ignore -the IMAGERY and SINCE filters, the panel hides each filter row no lit provider -honours (`filterControls`), and the legend lists only providers that draw -lines, with "Selected" only beside one of them. The viewer is Google's `StreetViewPanorama` in its own +the IMAGERY and SINCE filters, and the panel hides each filter row no lit provider +honours (`filterControls`). The viewer is Google's `StreetViewPanorama` in its own element in the viewer host, without Google's fullscreen, close and address controls (the address goes in the caption); a pose goes out at once and again when the panorama's month, photographer and address arrive (one @@ -3631,8 +3628,7 @@ are no KartaView photos in it. A tile's lines are OSM way segments with photos and carry no sequence, date or projection, so `decode.js` chains segments that meet end to start (about four times fewer lines; linear time, at most 20,000 segments a tile and 5,000 points a line), they are -drawn as `kv:line:`, up to 1,600 per tile, and never highlighted -(`highlightsSequence: false`, so the legend has no "Selected"), and the +drawn as `kv:line:`, up to 1,600 per tile, and never highlighted, and the provider declares `filters: ['pano', 'since']` and `coverageLabel` ("N streets in view · click a line for its nearest photo"). KartaView filters coverage only in its PNG tiles (`/sequence/tiles/{x}/{y}/{z}.png?fieldOfView=360|plane&startDate=YYYY-MM-DD`; @@ -3641,8 +3637,7 @@ asked for), so a filtered tile is drawn from the cached JSON segments that lie on the filtered PNG's drawn pixels (`maskedSegments`: at least half the points sampled every 2 px have a drawn pixel within one; on Jakarta's 360° filter, 332 of 1,041 segments lie on it, 676 miss it, 33 fall between). -A filter change reloads the lines (`lineCoverage.reload`: the drawn ones show -until the new ones are in), keeps the JSON segments, and caches masks per +A filter change reloads the lines (`lineCoverage.reload`), keeps the JSON segments, and caches masks per filter and tile. A dense filtered PNG can take KartaView over a minute the first time (it answers 504 at 60 s and keeps drawing), so a timeout or 5xx is asked again 4 s later, four tries in all; then the panel says it did not @@ -3669,7 +3664,7 @@ remembered; a storage timeout or 5xx is asked again. The open photo's sequence draws as cones from the 250-photo page holding it (`/2.0/sequence/{id}/photos`); the panel counts the drive's own photos (`countActivePhotos`, asked once per sequence). The camera direction (the -marker, cones, FOLLOW, and a panorama's centre) is the direction of travel +marker, cones and a panorama's centre) is the direction of travel to the next photo a few metres on (`assignCourses`): KartaView is dashcam imagery, while its `heading` is the device compass, which reads 0 for whole drives without one and can sit a steady 110° off inside a car. Until the @@ -3726,23 +3721,18 @@ to 30 km and z10 to 60 km, as Mapillary's (a dense z10 tile over Paris is line (Douglas–Peucker to the segment, 4 units of a 4,096 tile: about a pixel where it is drawn, 6–10% of a GPS track's points), and the tiles in view draw their longest lines within 90,000 points (`maxPoints`, -`keepOrder`), shared out once loading settles so a sparse tile keeps all -it has and a dense one (a city centre) takes the rest; the selected -sequence is always drawn. Every point becomes ~8 ground-line vertices: +`keepOrder`), split evenly between the tiles in view (10,000 points +each). Every point becomes ~8 ground-line vertices: unsimplified, the lines hung the tab. Decoded tiles are kept while the -provider is on (16, ten minutes, `tileCache.js`, shared with KartaView), -and above -60 km the `grid` layer's 0.1° -density cells, binned to at most 96×96 points a tile (a z0 tile holds -~70,000 cells) and not counted as sequences: the panel says to zoom in. +provider is on (16, ten minutes, `tileCache.js`, shared with KartaView). +Above 60 km nothing is drawn and the panel says to zoom in. A tile decodes in slices of about 8 ms, the page getting a turn between them (a 2 MB z10 tile is ~200 ms of work). A busy API (429/503) holds the tiles back for its Retry-After, which the browser cannot read here (the API exposes no headers), so the wait doubles from 5 s to 5 minutes until it answers; an answer may take as long as it keeps arriving (silent for 15 s is given up), so a slow link still gets its megabyte tiles. Both -filters apply: lines carry their day and camera type, and a cell stays while -it holds pictures of the kind asked for (cells are undated). A click on a +filters apply: lines carry their day and camera type. A click on a line asks the core (`actions.openNearest`) for that sequence's picture nearest the click, within the camera height / 100 (50–400 m: from high up a click lands well off a line), without framing, then any sequence's within @@ -3791,8 +3781,9 @@ runs against real Mapillary and needs `MAPILLARY_CLIENT_TOKEN`. `npm run qa:street-level:fixtures -- --url ` answers every Mapillary request from fixtures (`providers/mapillary/coverageFixture.mjs`, `scripts/fixtures/street-level/`), and KartaView's and Panoramax's too, so it -needs no network and covers the whole photo flow. CI runs the fixture gate and `qa:panel-resize` -against a production build served by `vite preview` with a dummy token. +needs no network. It opens and closes a photo from Mapillary, KartaView and +Panoramax; stepping, EXPAND, FIT/FILL, the filters and Street View stay with +the unit tests. CI runs the fixture gate against a production build served by `vite preview` with a dummy token. Directions is a keyless front end to the routing the voice agent already uses. Its row chips are the whole interface: DRIVE / WALK / BIKE pick the @@ -5096,7 +5087,7 @@ pins and share links already supply complete boxes. Pixel-mode pinch deltas receive bounded amplification before reaching the canvas; ordinary wheel, line/page-mode and native touch-pinch paths are left unchanged. The application scene owns and removes the relay listener. -- Z ladder: panels promote within 100–139 (renormalized on wrap), voice pill 150, toast 200, clean-view exit 300. +- Z ladder: panels around 100, voice pill 150, toast 200, clean-view exit 300. - Panel POSITION keys are versioned `v8` (`godsEyeView.v8.panelPos.`); collapsed-state keys remain `v6`. The one-time position reset clears stale DISPLAY placements that could overlap the Context rail. - Map Source lives in the bottom Visual Presets tray. The left accordion contains no MAP STACK panel, and the `k` panel token that addressed it is gone from the share registry, so legacy `ui=k...` state takes the ordinary unknown-token skip. - A dock popover (Visual Presets, Location) auto-dismisses on mouse-away unless pinned. Focus inside the tray defers that dismissal only when the browser reports `:focus-visible` — keyboard focus and typed-into fields hold the tray open; a mouse-clicked tile does not, because Chromium focuses a `