| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat(plugins): NASA Earthaccess plugin for CMR search and Earthdata download (#3085) * feat(plugins): add NASA Earthaccess plugin for CMR search and download Add a Web Services plugin that searches NASA's Common Metadata Repository for datasets and granules over the map view and a date range, draws granule footprints as a Layers-panel entry, and downloads granules with an Earthdata Login token. ICESat-2 (ATL06, ATL08) and GEDI (L2A, L2B, L4A) granules open straight into Add Data -> ICESat-2 / GEDI. The DAACs send no CORS headers and refuse a preflighted Authorization header, so downloads need a non-browser hop: - Desktop: a new native download_remote_file command streams the file to disk (no 64 MiB cap, progress over a channel, cancellable), either to a path picked in a native save dialog or to the app cache, read back once by take_cached_download. JavaScript never names a write path. Exposed to plugins as app.downloadRemoteFile. - Web: a new /earthdata/download route on the tiles Worker, origin gated, that accepts only NASA Earthdata data hosts, sends the bearer token to the first hop only, follows the presigned CloudFront/S3 redirect, and streams the file back with CORS and no-store. Desktop users can also sign in with a user name and password (via nativeFetch, since the EDL token endpoint has no CORS); only the returned token is kept, in the keychain through app.credentials. Part of #3078 (Phase 2: granule search and authenticated download). * fix(earthaccess): Earthdata Search details link, CI checks CMR serves granule records only as metadata formats, so Details now opens the granule in Earthdata Search. Also add the plugin to the generated plugin reference, list downloadRemoteFile as a desktop-only app API member, and typecheck the Worker proxy test with the Workers types. * Address Claude review feedback - earthdata.ts: catch a malformed redirect Location and answer 502 with CORS instead of an uncaught 500, and narrow the redirect allowlist from all of amazonaws.com to S3 endpoints. - remote_download.rs: request Accept-Encoding: identity (and keep callers from overriding it) so the Content-Length check compares like with like. - remote_download.rs: reject a reused request ID before the save dialog opens, and never let a new cache entry orphan an earlier one's file. * feat(earthaccess): multi-file download and NASA COG map layers - Multi-file granules (an HLS scene has 15 files) get a collapsible file list with a Download per file, and Download all: the desktop app asks for a folder once (new pick_download_folder command; JavaScript holds only the folder's id, never a path), the browser saves each file. - GeoTIFFs in the list get Add, which puts them on the map as COG layers. The COG readers fetch with the global fetch and take no headers, and the DAACs send no CORS headers, so a layer reads through the tiles Worker relay. Its saved URL carries no token; a fetch wrapper installed at boot adds the Earthdata Login token to requests for that exact route, so reopened projects keep working. - The Worker caches presigned redirect targets (keyed by a hash of the token and URL, in memory and in the edge cache, 50 minutes), cutting a cached range request from about 1.9 s to about 0.1 s. - File names in the list drop the shared granule prefix (B04.tif), and toggling the list no longer closes it by re-rendering the card. * fix(earthaccess): refresh Add/Added when a COG layer is removed The panel computed a file's Added state only when it re-rendered, so removing the layer from the Layers panel left the button disabled. The panel now re-renders when the set of Earthdata COG layers in the store changes, and ignores unrelated layer edits. * Address review feedback - earthdata.ts: restrict the content-disposition file name to [A-Za-z0-9._-] so an odd URL path cannot make Headers.set throw, and request identity encoding upstream so Content-Length matches the body. - spaceborne-lidar-handoff.ts: isolate listener failures so one bad listener cannot stop the others or reach the plugin. - maplibre-earthaccess.ts: fill MultiPolygon footprints too (CMR reports several polygons or boxes for some granules). - maplibre-earthaccess.ts: freeze the search's date range so Load more pages the same query after the date inputs are edited. - maplibre-earthaccess.ts: give the token link an href so keyboard users can reach it. - remote_download.rs: a folder download never replaces an existing file (adds " (n)"), and folder ids come from a counter. * Address Claude review feedback - maplibre-earthaccess.ts / earthdata-relay.ts: send the Earthdata token only to HTTPS NASA Earthdata data hosts (isEarthdataDataUrl). CMR data links are chosen by each provider, so a link on another host gets no token on desktop, has no Add, and opens in a new tab on the web (the relay serves Earthdata hosts only). - remote_download.rs: accept only Authorization, Cookie and Accept headers (the ones reqwest strips on a cross-host redirect, plus Accept), and refuse to send them over plain HTTP; the module docs now say exactly which headers stay on the first host. - earthdata-fetch-auth.ts: install the fetch wrapper through an explicit installEarthdataFetchAuth() call in main.tsx, placed right before installDiagnosticsCapture(), instead of an import side effect. * Address review feedback - remote_download.rs: requests that carry credentials use a client whose redirects must stay on HTTPS, since reqwest strips credentials only when the host changes (a same-host https -> http hop would resend them). - remote_download.rs: a folder download reserves its destination with create_new before transferring (name, then "name (n)"), streams into a request-specific .part file, and removes the placeholder if it fails, so concurrent downloads of one name never collide or replace a file. - types.ts / remote-download.ts: GeoLibreRemoteDownloadOptions is a discriminated union that requires folderId for "folder", and the host rejects a missing id at runtime. - maplibre-earthaccess.ts: the browser's Download all reports that the downloads started and mentions the multiple-downloads prompt, instead of claiming every file was saved. - earthdata.ts: edge-cache hits go through rememberPresigned so the in-memory cap applies. * Address review feedback - earthdata.ts: cache the first redirect only when it is a presigned target, not another Earthdata host that would fail the tokenless replay and be evicted on every request. - remote_download.rs: report a panicked transfer task as a failure, not as "cancelled". - remote_download.rs: create the folder placeholder's cleanup guard right after the reservation and move it into the task, so an abort before the task first runs still removes the empty file. | 17 天前 | |
chore(deps): bump the npm-minor-patch group across 1 directory with 29 updates (#3223) * chore(deps): bump the npm-minor-patch group across 1 directory with 29 updates Bumps the npm-minor-patch group with 29 updates in the / directory: | Package | From | To | | --- | --- | --- | | [happy-dom](https://github.com/capricorn86/happy-dom) | `21.0.3` | `21.0.4` | | [linkedom](https://github.com/WebReflection/linkedom) | `0.18.13` | `0.18.14` | | [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) | `8.71.2` | `8.72.0` | | [@aws-sdk/client-bedrock](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-bedrock) | `3.1152.0` | `3.1156.0` | | [@clerk/react](https://github.com/clerk/javascript/tree/HEAD/packages/react) | `6.17.8` | `6.18.0` | | [@electric-sql/pglite](https://github.com/electric-sql/pglite/tree/HEAD/packages/pglite) | `0.5.10` | `0.5.11` | | [@electric-sql/pglite-postgis](https://github.com/electric-sql/pglite/tree/HEAD/packages/pglite-postgis) | `0.2.10` | `0.2.11` | | [@geoman-io/maplibre-geoman-free](https://github.com/geoman-io/maplibre-geoman) | `0.10.1` | `0.10.2` | | [@google/genai](https://github.com/googleapis/js-genai) | `2.30.0` | `2.31.0` | | [@opentelemetry/api](https://github.com/open-telemetry/opentelemetry-js) | `1.9.1` | `1.10.0` | | [@strands-agents/sdk](https://github.com/strands-agents/harness-sdk) | `1.21.0` | `1.22.0` | | [@tanstack/react-virtual](https://github.com/TanStack/virtual/tree/HEAD/packages/react-virtual) | `3.14.21` | `3.14.22` | | [i18next](https://github.com/i18next/i18next) | `26.4.7` | `26.5.6` | | [openai](https://github.com/openai/openai-node) | `7.36.0` | `7.43.0` | | [react-i18next](https://github.com/i18next/react-i18next) | `17.0.20` | `17.1.4` | | [sql.js](https://github.com/sql-js/sql.js) | `1.15.0` | `1.15.1` | | [@tauri-apps/cli](https://github.com/tauri-apps/tauri) | `2.12.3` | `2.12.4` | | [postcss](https://github.com/postcss/postcss) | `8.5.30` | `8.5.31` | | [undici](https://github.com/nodejs/undici) | `8.12.2` | `8.12.3` | | [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) | `8.3.4` | `8.3.5` | | [lucide](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide) | `1.58.0` | `1.61.0` | | [vite-plugin-singlefile](https://github.com/richardtallent/vite-plugin-singlefile) | `2.3.3` | `2.3.4` | | [zustand](https://github.com/pmndrs/zustand) | `5.0.15` | `5.0.16` | | [tsdown](https://github.com/rolldown/tsdown) | `0.23.1` | `0.23.2` | | [hyparquet](https://github.com/hyparam/hyparquet) | `1.31.4` | `1.31.5` | | [webdggrid](https://github.com/am2222/webDggrid) | `1.9.3` | `1.11.0` | | [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) | `1.58.0` | `1.61.0` | | [wrangler](https://github.com/cloudflare/workers-sdk/tree/HEAD/packages/wrangler) | `4.151.1` | `4.152.0` | | [@cloudflare/workers-types](https://github.com/cloudflare/workerd) | `5.20261016.1` | `5.20261023.1` | Updates `happy-dom` from 21.0.3 to 21.0.4 - [Release notes](https://github.com/capricorn86/happy-dom/releases) - [Commits](https://github.com/capricorn86/happy-dom/compare/v21.0.3...v21.0.4) Updates `linkedom` from 0.18.13 to 0.18.14 - [Commits](https://github.com/WebReflection/linkedom/compare/v0.18.13...v0.18.14) Updates `typescript-eslint` from 8.71.2 to 8.72.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.72.0/packages/typescript-eslint) Updates `@aws-sdk/client-bedrock` from 3.1152.0 to 3.1156.0 - [Release notes](https://github.com/aws/aws-sdk-js-v3/releases) - [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-bedrock/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.1156.0/clients/client-bedrock) Updates `@clerk/react` from 6.17.8 to 6.18.0 - [Release notes](https://github.com/clerk/javascript/releases) - [Changelog](https://github.com/clerk/javascript/blob/main/packages/react/CHANGELOG.md) - [Commits](https://github.com/clerk/javascript/commits/@clerk/react@6.18.0/packages/react) Updates `@electric-sql/pglite` from 0.5.10 to 0.5.11 - [Release notes](https://github.com/electric-sql/pglite/releases) - [Changelog](https://github.com/electric-sql/pglite/blob/main/packages/pglite/CHANGELOG.md) - [Commits](https://github.com/electric-sql/pglite/commits/@electric-sql/pglite@0.5.11/packages/pglite) Updates `@electric-sql/pglite-postgis` from 0.2.10 to 0.2.11 - [Release notes](https://github.com/electric-sql/pglite/releases) - [Changelog](https://github.com/electric-sql/pglite/blob/@electric-sql/pglite-postgis@0.2.11/packages/pglite-postgis/CHANGELOG.md) - [Commits](https://github.com/electric-sql/pglite/commits/@electric-sql/pglite-postgis@0.2.11/packages/pglite-postgis) Updates `@geoman-io/maplibre-geoman-free` from 0.10.1 to 0.10.2 - [Release notes](https://github.com/geoman-io/maplibre-geoman/releases) - [Changelog](https://github.com/geoman-io/maplibre-geoman/blob/master/CHANGELOG.md) - [Commits](https://github.com/geoman-io/maplibre-geoman/compare/v0.10.1...v0.10.2) Updates `@google/genai` from 2.30.0 to 2.31.0 - [Release notes](https://github.com/googleapis/js-genai/releases) - [Changelog](https://github.com/googleapis/js-genai/blob/main/CHANGELOG.md) - [Commits](https://github.com/googleapis/js-genai/compare/v2.30.0...v2.31.0) Updates `@opentelemetry/api` from 1.9.1 to 1.10.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-js/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-js/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-js/compare/v1.9.1...v1.10.0) Updates `@strands-agents/sdk` from 1.21.0 to 1.22.0 - [Release notes](https://github.com/strands-agents/harness-sdk/releases) - [Commits](https://github.com/strands-agents/harness-sdk/compare/v1.21.0...v1.22.0) Updates `@tanstack/react-virtual` from 3.14.21 to 3.14.22 - [Release notes](https://github.com/TanStack/virtual/releases) - [Changelog](https://github.com/TanStack/virtual/blob/main/packages/react-virtual/CHANGELOG.md) - [Commits](https://github.com/TanStack/virtual/commits/@tanstack/react-virtual@3.14.22/packages/react-virtual) Updates `i18next` from 26.4.7 to 26.5.6 - [Release notes](https://github.com/i18next/i18next/releases) - [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md) - [Commits](https://github.com/i18next/i18next/compare/v26.4.7...v26.5.6) Updates `openai` from 7.36.0 to 7.43.0 - [Release notes](https://github.com/openai/openai-node/releases) - [Changelog](https://github.com/openai/openai-node/blob/main/CHANGELOG.md) - [Commits](https://github.com/openai/openai-node/compare/v7.36.0...v7.43.0) Updates `react-i18next` from 17.0.20 to 17.1.4 - [Changelog](https://github.com/i18next/react-i18next/blob/master/CHANGELOG.md) - [Commits](https://github.com/i18next/react-i18next/compare/v17.0.20...v17.1.4) Updates `sql.js` from 1.15.0 to 1.15.1 - [Release notes](https://github.com/sql-js/sql.js/releases) - [Commits](https://github.com/sql-js/sql.js/compare/v1.15.0...v1.15.1) Updates `@tauri-apps/cli` from 2.12.3 to 2.12.4 - [Release notes](https://github.com/tauri-apps/tauri/releases) - [Commits](https://github.com/tauri-apps/tauri/compare/@tauri-apps/cli-v2.12.3...@tauri-apps/cli-v2.12.4) Updates `postcss` from 8.5.30 to 8.5.31 - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.5.30...8.5.31) Updates `undici` from 8.12.2 to 8.12.3 - [Release notes](https://github.com/nodejs/undici/releases) - [Commits](https://github.com/nodejs/undici/compare/v8.12.2...v8.12.3) Updates `vite` from 8.3.4 to 8.3.5 - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v8.3.5/packages/vite) Updates `lucide` from 1.58.0 to 1.61.0 - [Release notes](https://github.com/lucide-icons/lucide/releases) - [Commits](https://github.com/lucide-icons/lucide/commits/1.61.0/packages/lucide) Updates `vite-plugin-singlefile` from 2.3.3 to 2.3.4 - [Release notes](https://github.com/richardtallent/vite-plugin-singlefile/releases) - [Changelog](https://github.com/richardtallent/vite-plugin-singlefile/blob/main/CHANGELOG.md) - [Commits](https://github.com/richardtallent/vite-plugin-singlefile/commits) Updates `zustand` from 5.0.15 to 5.0.16 - [Release notes](https://github.com/pmndrs/zustand/releases) - [Commits](https://github.com/pmndrs/zustand/compare/v5.0.15...v5.0.16) Updates `tsdown` from 0.23.1 to 0.23.2 - [Release notes](https://github.com/rolldown/tsdown/releases) - [Commits](https://github.com/rolldown/tsdown/compare/v0.23.1...v0.23.2) Updates `hyparquet` from 1.31.4 to 1.31.5 - [Changelog](https://github.com/hyparam/hyparquet/blob/master/CHANGELOG.md) - [Commits](https://github.com/hyparam/hyparquet/compare/v1.31.4...v1.31.5) Updates `webdggrid` from 1.9.3 to 1.11.0 - [Release notes](https://github.com/am2222/webDggrid/releases) - [Changelog](https://github.com/am2222/webDggrid/blob/main/CHANGELOG.md) - [Commits](https://github.com/am2222/webDggrid/compare/v1.9.3...v1.11.0) Updates `lucide-react` from 1.58.0 to 1.61.0 - [Release notes](https://github.com/lucide-icons/lucide/releases) - [Commits](https://github.com/lucide-icons/lucide/commits/1.61.0/packages/lucide-react) Updates `wrangler` from 4.151.1 to 4.152.0 - [Release notes](https://github.com/cloudflare/workers-sdk/releases) - [Commits](https://github.com/cloudflare/workers-sdk/commits/HEAD/packages/wrangler) Updates `@cloudflare/workers-types` from 5.20261016.1 to 5.20261023.1 - [Release notes](https://github.com/cloudflare/workerd/releases) - [Changelog](https://github.com/cloudflare/workerd/blob/main/RELEASE.md) - [Commits](https://github.com/cloudflare/workerd/commits) --- updated-dependencies: - dependency-name: happy-dom dependency-version: 21.0.4 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-minor-patch - dependency-name: linkedom dependency-version: 0.18.14 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-minor-patch - dependency-name: typescript-eslint dependency-version: 8.72.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-patch - dependency-name: "@aws-sdk/client-bedrock" dependency-version: 3.1156.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-patch - dependency-name: "@clerk/react" dependency-version: 6.18.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-patch - dependency-name: "@electric-sql/pglite" dependency-version: 0.5.11 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-patch - dependency-name: "@electric-sql/pglite-postgis" dependency-version: 0.2.11 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-patch - dependency-name: "@geoman-io/maplibre-geoman-free" dependency-version: 0.10.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-patch - dependency-name: "@google/genai" dependency-version: 2.31.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-patch - dependency-name: "@opentelemetry/api" dependency-version: 1.10.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-patch - dependency-name: "@strands-agents/sdk" dependency-version: 1.22.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-patch - dependency-name: "@tanstack/react-virtual" dependency-version: 3.14.22 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-patch - dependency-name: i18next dependency-version: 26.5.6 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-patch - dependency-name: openai dependency-version: 7.43.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-patch - dependency-name: react-i18next dependency-version: 17.1.4 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-patch - dependency-name: sql.js dependency-version: 1.15.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-patch - dependency-name: "@tauri-apps/cli" dependency-version: 2.12.4 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-minor-patch - dependency-name: postcss dependency-version: 8.5.31 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-minor-patch - dependency-name: undici dependency-version: 8.12.3 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-minor-patch - dependency-name: vite dependency-version: 8.3.5 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-minor-patch - dependency-name: lucide dependency-version: 1.61.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-patch - dependency-name: vite-plugin-singlefile dependency-version: 2.3.4 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-minor-patch - dependency-name: zustand dependency-version: 5.0.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-patch - dependency-name: tsdown dependency-version: 0.23.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-minor-patch - dependency-name: hyparquet dependency-version: 1.31.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-patch - dependency-name: webdggrid dependency-version: 1.11.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-patch - dependency-name: lucide-react dependency-version: 1.61.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-patch - dependency-name: wrangler dependency-version: 4.152.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-patch - dependency-name: "@cloudflare/workers-types" dependency-version: 5.20261023.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Address review feedback - Align desktop and web CSP script paths with the bumped PGlite 0.5.11 and PostGIS 0.2.11 dependencies to fix the CI CSP assertions and allow their CDN modules to load. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Qiusheng Wu <giswqs@gmail.com> | 1 天前 | |
feat(basemaps): replace planetary basemaps with the OpenPlanetaryMap set (#1162) * feat(basemaps): replace planetary basemaps with the OpenPlanetaryMap set Swap the four slow planetary basemaps (two CARTO composites plus the two per-request USGS MapServer imagery mosaics) for the eight OpenPlanetaryMap Mars and Moon basemaps from https://openplanetarymap.org/basemaps/, and split the single "Planetary" section in the New Project and Change Basemap panels into per-body "The Moon" and "Mars" sections. Most OPM mosaics are single-layer rasters served from S3 buckets in the TMS scheme with no CORS header. MapLibre GL fetches raster tiles with fetch() (which enforces CORS), so those render black — the openplanetarymap.org site only gets away with it because Leaflet loads tiles as plain <img> elements. Add a Cloudflare Worker (workers/tiles, tiles.geolibre.app) that fetches each tile server-side, re-emits it with Access-Control-Allow-Origin and edge-caches it, so the mosaics load fast and work uniformly across the web, desktop, and Jupyter builds. The two CORS-enabled CARTO named maps are referenced directly. - core: 8 OPM basemaps with a new PlanetaryBasemap.scheme ("tms") field, probed native maxZoom per source, and a PLANETARY_BASEMAP_GROUPS export grouped by celestial body; the 6 CORS-less mosaics point at the tiles Worker. - map: pass the tile scheme through to the raster source. - desktop: render planetary basemaps as per-body sections in both panels; new sectionMoon/sectionMars i18n keys across all locales. - workers/tiles: named-dataset CORS/edge-cache proxy for the OPM S3 mosaics. * feat(basemaps): drop redundant body prefix from planetary basemap names The names now render under the per-body "The Moon" / "Mars" section headings, so the leading "Moon"/"Mars" (and the "Mars"/"Moon" in "OPM ... Basemap") were duplicating the section title. Display names only; ids and styleUrls unchanged. * Address Claude review feedback - map-controller: fall back to DEFAULT_BASEMAP when a `geolibre://basemap/…` sentinel no longer resolves (e.g. a project saved with a since-renamed basemap id), instead of passing the raw sentinel to MapLibre and blanking the map. - workers/tiles: guard the edge-cache put with `request.method === "GET"` — the Cache API throws a TypeError on a HEAD cache key, which the worker advertises support for. - planetary-sections: make planetaryBodySectionKey an exhaustive switch that throws for a body without a dedicated heading, so a future basemap group added without a section fails loudly instead of being silently captioned "Mars". * Address Claude review feedback (round 2) - workers/tiles: reject tile coordinates outside the pyramid (x,y >= 2**z) before proxying, so out-of-range /z/x/y can't be looped to hammer the OPM S3 buckets; cache upstream misses (403/404) briefly (max-age=300) so a repeated bad tile is served from the edge instead of re-hitting S3. - workers/tiles: drop HEAD support (GET/OPTIONS only) — MapLibre only issues GET, and HEAD complicated the GET-only Cache API keying for no consumer. - map-controller: fix awkward doc-comment line wrap. planetary-sections: the "silently maps to Mars" concern is already handled by the exhaustive switch-with-throw added in the prior commit; narrowing the param to "moon" | "mars" would break callers that pass EllipsoidId from PLANETARY_BASEMAP_GROUPS. * Address Claude review feedback (round 3) - workers/tiles: look up DATASETS with a hasOwnProperty guard so inherited keys like "constructor" (which the [a-z0-9-]+ path segment matches) can't resolve to a truthy Object.prototype member and slip past the 404 into a 502. - core: add a legacy planetary-basemap-id migration map so a project saved with a pre-rename sentinel (mars-opm, moon-opm, mars-viking, moon-lroc) resolves to the nearest current basemap instead of silently falling back to Earth — the two OPM composites keep their exact tiles under new ids. * Address Claude review feedback (round 4) - map-controller: console.warn when a planetary sentinel can't be resolved and the map falls back to the default basemap, so the swap isn't silent/hard to debug. - workers/tiles: exclude 429 (throttle) alongside 5xx from the negative cache, so a transient upstream blip on an otherwise-valid tile isn't pinned blank for the negative TTL — only genuine 403/404 past-native-zoom misses are cached. | 3 个月前 | |
feat(planetary): USGS basemaps for nine more celestial bodies (#1196) * feat(planetary): USGS basemaps for nine more celestial bodies Add Mercury, Venus, the four Galilean moons, Titan, Pluto, and Charon as selectable planetary basemaps. USGS Astrogeology only serves these as equirectangular WMS, so the tiles Worker now reprojects each tile to Web Mercator on the fly. Group the new bodies under one collapsible "Other celestial bodies" section, and make the on-map scale bar use the active body's radius instead of assuming Earth. * Address Claude review feedback - WMS path: skip negative-caching 5xx/429 upstream failures so a transient USGS outage/throttle isn't pinned as a blank tile, matching the OPM path. - Cap the /wms reprojection zoom (MAX_WMS_ZOOM) so a direct client can't run up Worker CPU + USGS load with unlimited high-z cache keys. - Add a [limits] cpu_ms block to wrangler.toml so the CPU-bound reprojection has a concrete budget and the code comment references a real setting. * Address CodeRabbit review feedback - Use Object.hasOwn() for both the OPM and WMS dataset lookups (ES2022, clearer than the hasOwnProperty.call form). * Address CodeRabbit review feedback - Replace the hand-rolled upng-js ambient declaration with the published @types/upng-js, switching to a namespace import; verified the reprojection still decodes/encodes correctly at runtime. * feat(planetary): use Venus MDIR colour in the planet switcher The Layers-panel celestial-body switcher now applies the Magellan C3-MDIR colour mosaic for Venus instead of the grayscale FMAP. * Address Claude review feedback - Lower MAX_WMS_ZOOM from 10 to 8 (one level above the datasets' native max) to shrink the high-zoom cache-key space a client could enumerate. - Log WMS reprojection failures (dataset/status/content-type) so a misconfigured dataset surfaces in Worker logs instead of failing silently as a blank tile. - Add tests asserting the picker groups: the nine non-Earth/Moon/Mars bodies land in the "other" section and it is sorted alphabetically by body name. - CollapsibleSection: pair aria-expanded with aria-controls via useId. * docs: document the expanded celestial-body basemaps Update the README, docs index, roadmap, and Adding Data guide to cover the new USGS Astrogeology basemaps (Mercury, Venus, the Galilean moons, Titan, Pluto, Charon) reprojected to Web Mercator, alongside the existing OpenPlanetaryMap Mars and Moon sets, the per-project ellipsoid, and the planet switcher. * Address Claude review feedback - Refresh the body-aware scale bar in applyMapPreferences, so changing the ellipsoid via Settings (without changing the basemap) updates the bar immediately instead of waiting for the next pan/zoom. * feat(planetary): auto-expand the Other bodies section for the active basemap The "Other celestial bodies" picker section stays collapsed by default but now opens automatically when the currently-active (or selected) basemap is one of those bodies, so the highlighted selection is never hidden. * Address Claude review feedback - Negative-cache WMS decode/warp/encode failures as a transparent tile (with a logged warning) instead of returning an uncached 502, so a misconfigured dataset degrades once rather than re-running the CPU-bound path forever. | 3 个月前 |