From 17637146bef580a08a323fff308eaa81db573a45 Mon Sep 17 00:00:00 2001 From: mind-one001 Date: Thu, 21 May 2026 15:56:33 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9C=A0=ED=95=98=EB=B0=A9=ED=96=A5=20?= =?UTF-8?q?=EC=A4=8C=EB=A0=88=EB=B2=A8=20=ED=91=9C=EC=8B=9C=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/sn/app/(map-layout)/map/page.tsx | 38 +++++++++++++++++++++------ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/apps/sn/app/(map-layout)/map/page.tsx b/apps/sn/app/(map-layout)/map/page.tsx index 90bfb5cae..51d4776af 100644 --- a/apps/sn/app/(map-layout)/map/page.tsx +++ b/apps/sn/app/(map-layout)/map/page.tsx @@ -1408,6 +1408,35 @@ const Map = () => { const [flowDirectionLayerInfo, setFlowDirectionLayerInfo] = useState(null); // 관종 레이어 체크 변경도 유하방향 재조회 조건이므로 별도 버전 state로 effect를 다시 실행한다. const [flowDirectionSelectionVersion, setFlowDirectionSelectionVersion] = useState(0); + // 줌레벨 컨트롤에 현재 체크된 특수 레이어의 최소 표출 기준을 안내한다. + const zoomGuide = useMemo(() => { + const flowDirectionGuideZoom = flowDirectionLayerInfo + ? getFlowDirectionMinZoom(flowDirectionLayerInfo) + : FLOW_DIRECTION_DEFAULT_MIN_ZOOM; + + if (isAgedPipeChecked && isFlowDirectionChecked) { + return { + label: "노후관로/유하방향 기준", + zoom: Math.max(AGED_PIPE_GUIDE_MIN_ZOOM, flowDirectionGuideZoom), + }; + } + + if (isFlowDirectionChecked) { + return { + label: "유하방향 기준", + zoom: flowDirectionGuideZoom, + }; + } + + if (isAgedPipeChecked) { + return { + label: "노후관로 기준", + zoom: AGED_PIPE_GUIDE_MIN_ZOOM, + }; + } + + return undefined; + }, [flowDirectionLayerInfo, isAgedPipeChecked, isFlowDirectionChecked]); // moveend 이벤트 핸들러는 최신 state closure를 보장하지 않으므로 현재 체크 여부를 ref로 함께 보관한다. const flowDirectionCheckedRef = useRef(false); // 지도 이동 후 재조회할 때 최신 유하방향 레이어 설정을 참조하기 위한 ref이다. @@ -3568,14 +3597,7 @@ const Map = () => { showZoomScaleInfo={true} showFloatingSearchButton={false} treeTogglePosition="top" - zoomGuide={ - isAgedPipeChecked - ? { - label: "노후관로 기준", - zoom: AGED_PIPE_GUIDE_MIN_ZOOM, - } - : undefined - } + zoomGuide={zoomGuide} defaultZoom={7.5} defaultLonLat={[127.75, 36]}