diff --git a/B05_Profile/B05_Profile_UI_Markers.ts b/B05_Profile/B05_Profile_UI_Markers.ts index e7b95c19..0ceb8bf7 100644 --- a/B05_Profile/B05_Profile_UI_Markers.ts +++ b/B05_Profile/B05_Profile_UI_Markers.ts @@ -8,7 +8,8 @@ export interface PlacedRoutePoint { type: RoutePointKind; x: number; y: number; - z: number; + /** 표고(m). `null`은 **모른다**는 뜻 — 계획노선 CSV로 만든 점이 그렇다. 0으로 눕히면 안 된다. */ + z: number | null; radius_m?: number; } @@ -72,7 +73,7 @@ function disposeGroup(group: THREE.Group): void { group.clear(); } -export function modelToScene(point: Pick, bounds: ModelBounds) { +export function modelToScene(point: { x: number; y: number; z: number }, bounds: ModelBounds) { const cx = (bounds.x[0] + bounds.x[1]) / 2; const cy = (bounds.y[0] + bounds.y[1]) / 2; const cz = (bounds.z[0] + bounds.z[1]) / 2; diff --git a/B05_Profile/B05_Profile_UI_Page.ts b/B05_Profile/B05_Profile_UI_Page.ts index f5f1eeb2..2ca77a05 100644 --- a/B05_Profile/B05_Profile_UI_Page.ts +++ b/B05_Profile/B05_Profile_UI_Page.ts @@ -97,7 +97,8 @@ function placed( type, x: point.x, y: point.y, - z: point.z ?? 0, + // 표고를 모르면 모르는 채로 넘긴다 — 0으로 눕히면 마커가 지형 한참 아래 평면에 깔린다. + z: point.z ?? null, ...(type === "ap" || type === "fp" ? { radius_m: (point as CirclePoint).radius_m ?? 25 } : {}), }; } @@ -114,7 +115,8 @@ function restorePoints(latest: RouteLatestResponse): RouteDesignPoints { } function routePoint(point: PlacedRoutePoint): RoutePoint { - return { x: point.x, y: point.y, z: point.z }; + // 서버 스키마는 표고를 빼면 "모름"으로 받는다 — null은 undefined로 바꿔 보낸다. + return { x: point.x, y: point.y, z: point.z ?? undefined }; } function circlePoint(point: PlacedRoutePoint): CirclePoint {