diff --git a/VERSION b/VERSION index 9b1bb851..8570a3ae 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.37.1 +0.37.2 diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index eb3dcfcb..5d4a5f73 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -8,6 +8,19 @@ This project follows the repository versioning rule: - `improvement` -> `+0.0.1`(bugfix + 小功能混合) - `bugfix` -> `+0.0.1` +## [0.37.2] — 2026-04-23 + +### ✨ Highlights +- Earth 图层系统新增经纬线开关,桌面图层面板与移动端抽屉都可直接控制 + +### 🔧 Improvements +- 经纬线正式接入 Earth layer registry,复用现有图层切换、移动端图层卡片与设置持久化流 + +### 🐛 Fixes +- 修复经纬线只能默认常驻、无法作为独立图层开关控制的问题 + +--- + ## [0.37.1] — 2026-04-23 ### ✨ Highlights diff --git a/docs/version-history.md b/docs/version-history.md index b43c098a..6df232c8 100644 --- a/docs/version-history.md +++ b/docs/version-history.md @@ -16,12 +16,13 @@ ## Current Version - `main` 当前主线历史推导到:`0.16.5` -- `dev` 当前开发分支历史推导到:`0.37.1` +- `dev` 当前开发分支历史推导到:`0.37.2` ## Timeline | Version | Type | Branch | Commit | Summary | | --- | --- | --- | --- | --- | +| `0.37.2` | bugfix | `dev` | `pending` | Earth 图层系统新增经纬线开关,并将经纬线接入统一 layer registry、移动端抽屉与设置持久化流 | | `0.37.1` | bugfix | `dev` | `pending` | 修复 `planet.sh` 在 `uvicorn --reload` 场景下未清理旧 worker 的问题,避免后端重启后仍停留旧实例并导致算力中心聚合接口 404 | | `0.37.0` | feature | `dev` | `pending` | Earth 连线系统从巡航语义中完全解耦为通用 callout connector,统一桌面/移动端对象级锚点、临界区锚点滑动与稳定巡航展示链路 | | `0.36.0` | feature | `dev` | `pending` | Earth 新增统一算力中心图层与估算位置展示,继续收口拖拽交互,并补充 AI Provider 指纹与 WSL 局域网访问支撑 | diff --git a/frontend/package.json b/frontend/package.json index 643cfcc0..179ce69b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "planet-frontend", - "version": "0.37.1", + "version": "0.37.2", "private": true, "packageManager": "bun@1", "dependencies": { diff --git a/frontend/public/earth/index.html b/frontend/public/earth/index.html index 04b0a9ab..b39924a1 100644 --- a/frontend/public/earth/index.html +++ b/frontend/public/earth/index.html @@ -118,6 +118,16 @@ +
+ grid_4x4 +
+ 经纬线 + Graticule +
+ +
satellite_alt
diff --git a/frontend/public/earth/js/controls.js b/frontend/public/earth/js/controls.js index 7ae0dd03..2ae9a6e2 100644 --- a/frontend/public/earth/js/controls.js +++ b/frontend/public/earth/js/controls.js @@ -3,7 +3,12 @@ import * as THREE from "three"; import { CONFIG, EARTH_CONFIG, ROTATION_MODE } from "./constants.js"; import { setEarthStatValue, updateZoomDisplay, showStatusMessage } from "./ui.js"; -import { toggleTerrain, setDayNightEnabled } from "./earth.js"; +import { + toggleTerrain, + setDayNightEnabled, + toggleGridLines, + getShowGridLines, +} from "./earth.js"; import { setCelestialDayNightEnabled } from "./celestial.js"; import { ensureTerrainReady, @@ -999,6 +1004,20 @@ async function setSatellitesLayerEnabled(button, enabled, { persist = true, sile } } +function setGridLinesLayerEnabled(button, enabled, { persist = true, silent = false } = {}) { + toggleGridLines(enabled); + setLayerButtonState(button, { + active: enabled, + tooltip: enabled ? "隐藏经纬线" : "显示经纬线", + }); + syncMobileLayerCards(); + if (persist) persistEarthSettings(); + if (!silent) { + showStatusMessage(enabled ? "经纬线已显示" : "经纬线已隐藏", "info"); + } + return enabled; +} + function setBGPLayerEnabled(button, enabled, { persist = true, silent = false } = {}) { clearSelectionIfHiding(!enabled); toggleBGP(enabled); @@ -1090,6 +1109,22 @@ function getBuiltinLayerDefinitions() { setVisible: (visible, options = {}) => setTerrainEnabled(getLayerButton("terrain"), visible, options), }, + { + id: "gridLines", + buttonId: "toggle-grid-lines", + icon: "grid_4x4", + label: "经纬线", + meta: "Graticule", + keywords: "经纬线 graticule 经纬 latitude longitude", + defaultActive: true, + startupPriority: null, + startupMode: "visible", + startupLabel: "经纬线", + startupMessage: "", + getVisible: () => getShowGridLines(), + setVisible: (visible, options = {}) => + setGridLinesLayerEnabled(getLayerButton("gridLines"), visible, options), + }, { id: "satellites", buttonId: "toggle-satellites", diff --git a/frontend/public/earth/js/earth.js b/frontend/public/earth/js/earth.js index 044c1618..2171c492 100644 --- a/frontend/public/earth/js/earth.js +++ b/frontend/public/earth/js/earth.js @@ -7,6 +7,7 @@ import { latLonToVector3 } from './utils.js'; export let earth = null; export let clouds = null; export let terrain = null; +let showGridLines = true; const textureLoader = new THREE.TextureLoader(); let _earthMaterial = null; @@ -321,6 +322,7 @@ export function createGridLines(scene, earthObj) { const geometry = new THREE.BufferGeometry().setFromPoints(points); const line = new THREE.Line(geometry, gridMaterial); line.userData = { type: 'latitude', value: lat }; + line.visible = showGridLines; earthObj.add(line); latitudeLines.push(line); } @@ -335,11 +337,26 @@ export function createGridLines(scene, earthObj) { const geometry = new THREE.BufferGeometry().setFromPoints(points); const line = new THREE.Line(geometry, gridMaterial); line.userData = { type: 'longitude', value: lon }; + line.visible = showGridLines; earthObj.add(line); longitudeLines.push(line); } } +export function toggleGridLines(visible) { + showGridLines = visible; + latitudeLines.forEach((line) => { + line.visible = visible; + }); + longitudeLines.forEach((line) => { + line.visible = visible; + }); +} + +export function getShowGridLines() { + return showGridLines; +} + export function getEarth() { return earth; } diff --git a/pyproject.toml b/pyproject.toml index 9d626dba..dfa5cf29 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "planet" -version = "0.37.1" +version = "0.37.2" description = "智能星球计划 - 态势感知系统" requires-python = ">=3.14" dependencies = [ diff --git a/uv.lock b/uv.lock index 98c35a5b..c6051b26 100644 --- a/uv.lock +++ b/uv.lock @@ -475,7 +475,7 @@ wheels = [ [[package]] name = "planet" -version = "0.37.1" +version = "0.37.2" source = { virtual = "." } dependencies = [ { name = "aiofiles" },