From d9cd7423552fae847ab8111332d415b323746a61 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Wed, 3 Sep 2025 15:07:44 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A7=80=EB=8F=84=20=ED=8C=9D=EC=97=85=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=97=86=EB=8A=94=EA=B2=BD?= =?UTF-8?q?=EC=9A=B0=20=EB=A9=94=EC=8B=9C=EC=A7=80=20=ED=91=9C=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wr/app/(popUp-layout)/mapFeaturePopup/page.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx b/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx index 3b1ec8a78..680f637d4 100644 --- a/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx +++ b/apps/wr/app/(popUp-layout)/mapFeaturePopup/page.tsx @@ -20,7 +20,7 @@ export default function MapFeaturePopup() { coSttnMapDetail } = useWrStore((state) => state); const { pbnMapHeadList } = pbnMap; - const [isDetail, setIsDetail] = useState(null); + const [isDetail, setIsDetail] = useState(undefined); const [layerNm, setLayerNm] = useState(); const searchParams = useSearchParams(); @@ -45,6 +45,15 @@ export default function MapFeaturePopup() { }; }, []); + useEffect(() => { + if(isDetail ===null){ + alert("해당시설은 X,Y좌표를 찾을수 없어 위치를 찾을수 없습니다."); + window.close(); // isDetail이 null이면 팝업 닫기 + } + console.log("isDetail", isDetail); + }, [isDetail]); + + useEffect(() => { if (isFeatureCd && layerNm) { if (layerNm === "tb_wr_bdst_ruse_fclt") { @@ -55,6 +64,7 @@ export default function MapFeaturePopup() { }); } else if (layerNm === "tb_wr_rnwtr_utztn_fclt") { rainMapDetile(isFeatureCd).then((res) => { + setIsDetail(res); }); } else if (layerNm === "tb_wr_rswtr_fclt") { @@ -78,7 +88,7 @@ export default function MapFeaturePopup() { } }, [isFeatureCd, layerNm]); - if (!isDetail) return null; // 데이터 없으면 아무것도 안 그림 + if (isDetail === undefined) return null; // 데이터 없으면 아무것도 안 그림 return ( <> {isDetail ? (