From 2a5cbe474b79a85d5c6570277c67e6931cc3ddf3 Mon Sep 17 00:00:00 2001 From: chengkai3 Date: Fri, 12 Jun 2026 22:56:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:[FL-92][=E9=AB=98=E7=A8=8B=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=AE=A1=E7=90=86=E9=A2=84=E8=A7=88=E6=97=B6=E5=9C=B0?= =?UTF-8?q?=E5=BD=A2=E5=9B=BE=E6=B8=B2=E6=9F=93=E4=B8=8D=E5=87=BA=E6=9D=A5?= =?UTF-8?q?]=20-=20=E6=B7=BB=E5=8A=A0minzoom=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复地形图layer.json缺少minzoom字段导致Cesium无法正确加载地形的问题。 根本原因: - Cesium地形加载需要layer.json同时包含minzoom和maxzoom字段 - 之前只有maxzoom字段,导致Cesium不知道从哪个层级开始加载地形 - 虽然瓦片数据正常(API返回200),但前端无法正确渲染三维地形 修改内容: 1. 在ElevationTerrainLayerResponse模型中添加minzoom字段(schemas/elevation.py) 2. 在地形构建代码中设置minzoom=0(services/elevation_service.py) 3. 地形瓦片的zoom level范围现在完整定义为0-6 影响: - 已构建的地形数据需要重新触发构建任务才能生成包含minzoom的新layer.json - 新构建的地形将自动包含minzoom字段 Co-Authored-By: Claude Sonnet 4.6 Co-authored-by: multica-agent --- api/app/schemas/elevation.py | 1 + api/app/services/elevation_service.py | 1 + 2 files changed, 2 insertions(+) diff --git a/api/app/schemas/elevation.py b/api/app/schemas/elevation.py index 5bac01c..c3cac4c 100644 --- a/api/app/schemas/elevation.py +++ b/api/app/schemas/elevation.py @@ -206,6 +206,7 @@ class ElevationTerrainLayerResponse(BaseModel): scheme: Literal["tms"] = "tms" projection: Literal["EPSG:4326"] = "EPSG:4326" tiles: list[str] + minzoom: int maxzoom: int extensions: list[str] = Field(default_factory=list) attribution: str | None = None diff --git a/api/app/services/elevation_service.py b/api/app/services/elevation_service.py index 915d105..bf9c43d 100644 --- a/api/app/services/elevation_service.py +++ b/api/app/services/elevation_service.py @@ -3083,6 +3083,7 @@ def _build_dataset_terrain_tiles(db: Session, dataset: ElevationDataset) -> _Ter layer_payload = ElevationTerrainLayerResponse( tiles=[f"{{z}}/{{x}}/{{y}}.terrain?v={TERRAIN_TILE_VERSION}"], + minzoom=0, maxzoom=max_zoom, attribution=f"{dataset.code} {dataset.name}", bounds=[bounds["west"], bounds["south"], bounds["east"], bounds["north"]],