fix(D 예정노선): 받기에 늘 지금 기준점을 실음 — 저장된 자리로 되돌아와도 「멀리 옮김」 물음 (PLAN 596-2)

- 저장된 자리와 같으면 기준점을 안 실어 서버가 옛 범위와 합치려다 칸 상한으로 거절되던 길
- 들어올 때 범위 · 받기 · 다시 받기 모두 기준점 둘레를 함께 봄 · [저장] 몸 site 는 바뀐 때만

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-30 16:22:33 +09:00
co-authored by Claude Opus 5.5
parent 7c5303a79c
commit 09bef8b0ee
+6 -7
View File
@@ -250,11 +250,10 @@ export async function renderD03PlanAnalysis(root: HTMLElement): Promise<void> {
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<void> {
* 아니오 = 안 받음(거짓). 이미 도는 일(다른 창)이면 그것을 지켜봄. */
async function download(extra: Vertex[]): Promise<boolean> {
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<void> {
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();