diff --git a/D03_PlanAnalysis/D03_PlanAnalysis_UI_Page.ts b/D03_PlanAnalysis/D03_PlanAnalysis_UI_Page.ts index a83b23978..590e97774 100644 --- a/D03_PlanAnalysis/D03_PlanAnalysis_UI_Page.ts +++ b/D03_PlanAnalysis/D03_PlanAnalysis_UI_Page.ts @@ -250,11 +250,10 @@ export async function renderD03PlanAnalysis(root: HTMLElement): Promise { const allVertices = (): Vertex[] => network.lines.flatMap((line) => line.vertices); const snap = (): Snap => ({ network, points, pointNames, site }); - /** 위치를 옮기고 [저장] 전 — 받기 · 범위 물음에 새 기준점을 실음. */ - const moved = (): TerrainAim["center"] => - site && JSON.stringify(site) !== JSON.stringify(savedSite) - ? { lon: site.lon, lat: site.lat } - : null; + /** 위치를 옮기고 [저장] 전 — [저장] 몸에 기준점을 실음. */ + const moved = (): boolean => !!site && JSON.stringify(site) !== JSON.stringify(savedSite); + /** 받기 · 범위에 늘 지금 기준점(캐시)을 실음 — 받은 범위에서 멀면 서버가 물음(저장된 자리로 되돌아올 때도). */ + const center = (): TerrainAim["center"] => (site ? { lon: site.lon, lat: site.lat } : null); /** 기준점 둘레 ±1 km(작업 좌표) — 처음 맞춤 · 위치 옮김 · 임도망 맞춤. */ const around = (at: Site | null): Vertex[] => { const tm = tmParams(epsg); @@ -381,7 +380,7 @@ export async function renderD03PlanAnalysis(root: HTMLElement): Promise { * 아니오 = 안 받음(거짓). 이미 도는 일(다른 창)이면 그것을 지켜봄. */ async function download(extra: Vertex[]): Promise { busy = true; // 요청이 가는 동안 다른 받기를 막음(지켜보기가 이어 받음) - const where: TerrainAim = { center: moved() }; + const where: TerrainAim = { center: center() }; try { let answer: TerrainStart = await startTerrain(projectId, null, extra, where); if (answer.status === "far" || answer.status === "band") { @@ -659,7 +658,7 @@ export async function renderD03PlanAnalysis(root: HTMLElement): Promise { await follow(); } else if (editable && !job.error) { // 들어올 때 받은 범위가 기준점 둘레 · 지점을 못 덮으면 바로 받기(서버가 셈 · 실패 뒤엔 [다시 받기]) - const extent = await fetchTerrainExtent(projectId, null, [], moved()); + const extent = await fetchTerrainExtent(projectId, null, [], center()); ready = true; if (!extent.covered) await download([]); else await ensureCovered();