diff --git a/D03_PlanAnalysis/D03_PlanAnalysis_UI_Layers.ts b/D03_PlanAnalysis/D03_PlanAnalysis_UI_Layers.ts index fd78809cc..37c06a608 100644 --- a/D03_PlanAnalysis/D03_PlanAnalysis_UI_Layers.ts +++ b/D03_PlanAnalysis/D03_PlanAnalysis_UI_Layers.ts @@ -257,9 +257,13 @@ export function createPlanLayers(opts: { ); return info; }); + // 거절은 아래 catch 가 알림 — 기다림 몫은 삼킴(처리 안 된 거절 없음) pending.set( "forestRoadFile", - job.then(() => undefined), + job.then( + () => undefined, + () => undefined, + ), ); try { return await job; diff --git a/D03_PlanAnalysis/D03_PlanAnalysis_UI_Page.ts b/D03_PlanAnalysis/D03_PlanAnalysis_UI_Page.ts index 848270be6..a83b23978 100644 --- a/D03_PlanAnalysis/D03_PlanAnalysis_UI_Page.ts +++ b/D03_PlanAnalysis/D03_PlanAnalysis_UI_Page.ts @@ -388,9 +388,7 @@ export async function renderD03PlanAnalysis(root: HTMLElement): Promise { const band = answer.status === "band"; const ok = await askConfirm({ title: band ? "다른 좌표 띠로 옮김" : "멀리 옮김", - message: band - ? `${answer.message} 그은 선 · 지점을 지우고 새 자리 둘레를 받습니다.` - : `${answer.message} 받은 지형을 버리고 새 자리 둘레를 받습니다.`, + message: band ? `${answer.message} 그은 선 · 지점을 지웁니다.` : answer.message, okLabel: "새로 받기", danger: band, }); @@ -419,7 +417,8 @@ export async function renderD03PlanAnalysis(root: HTMLElement): Promise { epsg = next; [network, points, pointNames] = [emptyNetwork(), [], []]; [undoStack, redoStack, have] = [[], [], null]; - map.update({ epsg }); + map.update({ epsg, fit: around(site) }); // 맞춤 상자도 새 띠 좌표로 + map.fit(); keepDraft(); } diff --git a/D03_PlanAnalysis/D03_PlanAnalysis_UI_Site.ts b/D03_PlanAnalysis/D03_PlanAnalysis_UI_Site.ts index 1670ccf37..b788950eb 100644 --- a/D03_PlanAnalysis/D03_PlanAnalysis_UI_Site.ts +++ b/D03_PlanAnalysis/D03_PlanAnalysis_UI_Site.ts @@ -8,7 +8,7 @@ import { pickFiles } from "@ui/ui_template_drop"; import { createButton } from "@ui/ui_template_elements"; -import { createFindList, type FindList } from "@ui/ui_template_find_list"; +import { createFindList, type FindList, type FindRow } from "@ui/ui_template_find_list"; import { t } from "@ui/ui_template_locale"; import { createText } from "@ui/ui_template_text"; import { searchPlaces, type PlaceHit } from "./D03_PlanAnalysis_Api"; @@ -41,26 +41,38 @@ export interface PlanSite { * 등록(D01) 지도 머리 · 이 「위치」 칸이 같이 씀. */ export function createPlaceFind(onPick: (hit: PlaceHit) => void): FindList { const find = createFindList({ placeholder: t("DE_Reg_Find") }); + const list = find.root.querySelector(".ui-find__list")!; let asked = 0; // 옛 찾기 답 버림 + // 빈 알림 · 빈 목록은 숨김(칸 사이 빈 틈 없앰) + const say = (text: string): void => { + find.hint.textContent = text; + find.hint.hidden = !text; + }; + const show = (rows: FindRow[]): void => { + find.setRows(rows); + list.hidden = !rows.length; + }; + say(""); + show([]); async function run(): Promise { const query = find.search.value.trim(); - find.setRows([]); - if (query.length < MIN_QUERY) return void (find.hint.textContent = t("DE_Reg_FindShort")); + show([]); + if (query.length < MIN_QUERY) return say(t("DE_Reg_FindShort")); const at = ++asked; - find.hint.textContent = t("DE_Reg_FindBusy"); + say(t("DE_Reg_FindBusy")); try { const hits = await searchPlaces(query); if (at !== asked) return; - find.hint.textContent = hits.length ? "" : t("DE_Reg_FindNone"); - find.setRows( + say(hits.length ? "" : t("DE_Reg_FindNone")); + show( hits.map((hit, i) => ({ key: String(i), tag: t(hit.kind === "place" ? "DE_Reg_FindPlace" : "DE_Reg_FindAddress"), name: hit.title, sub: hit.address !== hit.title ? hit.address : undefined, onPick: () => { - find.setRows([]); + show([]); find.search.value = hit.title; onPick(hit); }, @@ -68,11 +80,11 @@ export function createPlaceFind(onPick: (hit: PlaceHit) => void): FindList { ); } catch (error) { if (at === asked) - find.hint.textContent = `${t("DE_Reg_FindFail")} — ${error instanceof Error ? error.message : error}`; + say(`${t("DE_Reg_FindFail")} — ${error instanceof Error ? error.message : error}`); } } // 고를 줄이 있으면 부품이 Enter 를 먼저 씀(고름) · 없으면 찾기 · 글을 고치면 옛 줄 걷음 - find.search.addEventListener("input", () => find.setRows([])); + find.search.addEventListener("input", () => show([])); find.search.addEventListener("keydown", (event) => { if (event.key !== "Enter" || event.defaultPrevented || event.isComposing) return; event.preventDefault();