From 262cf21546fcd513704e1c6edf118722d9523fad Mon Sep 17 00:00:00 2001 From: swcho Date: Wed, 13 Aug 2025 17:20:40 +0900 Subject: [PATCH] =?UTF-8?q?remove:=20=EC=9E=98=EB=AA=BB=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=EB=90=9C=20=EB=AC=BC=EC=9E=AC=EC=9D=B4=EC=9A=A9(wr)?= =?UTF-8?q?=EC=9D=98=20=EA=B0=80=EB=AD=84=EC=A7=80=EB=8F=84=20=ED=8C=9D?= =?UTF-8?q?=EC=97=85=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/(popUp-layout)/mapDrgtPopUp/page.tsx | 90 ------------------- 1 file changed, 90 deletions(-) delete mode 100644 apps/wr/app/(popUp-layout)/mapDrgtPopUp/page.tsx diff --git a/apps/wr/app/(popUp-layout)/mapDrgtPopUp/page.tsx b/apps/wr/app/(popUp-layout)/mapDrgtPopUp/page.tsx deleted file mode 100644 index e126feb99..000000000 --- a/apps/wr/app/(popUp-layout)/mapDrgtPopUp/page.tsx +++ /dev/null @@ -1,90 +0,0 @@ -"use client"; - -import Gis from "@common/business_components/ui/map/Gis"; -import { useEffect, useRef, useState, useCallback } from "react"; -import { useSearchParams } from "next/navigation"; -import { mapService } from "../../(map-layout)/service"; -import { DrgtLegend, DRGT_LAYER_TYPES, EXPRS_ORDERED_LAYERS } from "./drgtLegend"; -import { SearchBar } from "./searchBar"; - - -export default function MapDrgtPopUp() { - const searchParams = useSearchParams(); - const ctpvCd = searchParams.get('ctpvCd') || ''; - const sggCd = searchParams.get('sggCd') || ''; - const fromDate = searchParams.get('fromDate') || ''; - const toDate = searchParams.get('toDate') || ''; - - const gisMaps = useRef(null); - const [treeData, setTreeData] = useState([]); // 초기값을 객체 또는 null로 설정 - const [isOpen, setIsOpen] = useState(false); // 팝업 열기/닫기 상태 - const [showDrgtLegend, setShowDrgtLegend] = useState(false); // DrgtLegend 표시 여부 - const [isPlaying, setIsPlaying] = useState(false); - - // 컴포넌트 마운트 시 1회 실행 - useEffect(() => { - fetchData(); - }, []); - - function fetchData() { - (async () => { - try { - const response = await mapService.getLyrStngs('WR_DROUGHT'); - setTreeData(response); // API 응답 저장 - console.log("Drought layers fetched:", response); - } catch (error) { - console.error("데이터 불러오기 실패:", error); - } - })(); - } - - // WaterDepth 표시 여부를 결정하는 함수 - const handleDrgtLegndVisibility = useCallback((checkedIds: string[], checkedNodesData: any[]) => { - const drgtLegndLayers = checkedNodesData.filter(node => - DRGT_LAYER_TYPES.includes(node.data?.lyrTyNm) - ); - - const hasDrgtLegndLayer = drgtLegndLayers.length > 0; - setShowDrgtLegend(hasDrgtLegndLayer); - }, []); - - // 체크된 레이어 변경 처리 함수 - const handleCheckedLayersChange = useCallback((checkedIds: string[], checkedNodesData: any[]) => { - handleDrgtLegndVisibility(checkedIds, checkedNodesData); - }, [handleDrgtLegndVisibility]); - - - - return ( -
- } - waterDepth={showDrgtLegend ? DrgtLegend : undefined} - isPlaying={isPlaying} - setIsPlaying={setIsPlaying as any} - targetLayerTypes={DRGT_LAYER_TYPES as any} - orderedLayers={EXPRS_ORDERED_LAYERS as any} - checkInterval={2500} - height={`h-[100vh]`} - droughtDates={{ startYmd: fromDate, endYmd: toDate }} - defaultZoom={7} - defaultLonLat={[127.4875, 36.4916]} - /> -
- ); -}