From 08bcfbf24d4b52c48f257700e8c9a3ed7894b19c Mon Sep 17 00:00:00 2001 From: "jeonghyo.k" Date: Wed, 1 Apr 2026 19:08:34 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix(map):=20S57=20ENC=20=EC=98=A4=EB=B2=84?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=20=EC=8A=A4=ED=83=80=EC=9D=BC=20=EB=A1=9C?= =?UTF-8?q?=EB=93=9C=20=EC=99=84=EB=A3=8C=20=EB=8C=80=EA=B8=B0=20=ED=9B=84?= =?UTF-8?q?=20=EB=A0=88=EC=9D=B4=EC=96=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- .../src/common/components/map/S57EncOverlay.tsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/frontend/src/common/components/map/S57EncOverlay.tsx b/frontend/src/common/components/map/S57EncOverlay.tsx index 692f336..0ad2e72 100644 --- a/frontend/src/common/components/map/S57EncOverlay.tsx +++ b/frontend/src/common/components/map/S57EncOverlay.tsx @@ -137,14 +137,21 @@ export function S57EncOverlay({ visible }: S57EncOverlayProps) { if (!map) return; if (visible) { - addEncLayers(map); + const doAdd = () => addEncLayers(map); + + if (map.isStyleLoaded()) { + doAdd(); + } else { + map.once('style.load', doAdd); + } + + return () => { + map.off('style.load', doAdd); + removeEncLayers(map); + }; } else { removeEncLayers(map); } - - return () => { - if (map) removeEncLayers(map); - }; // eslint-disable-next-line react-hooks/exhaustive-deps }, [visible, mapRef]); -- 2.45.2 From 6803fc156c7c31a3d117c4e4ab25d1c787d95042 Mon Sep 17 00:00:00 2001 From: "jeonghyo.k" Date: Wed, 1 Apr 2026 19:11:21 +0900 Subject: [PATCH 2/2] =?UTF-8?q?docs:=20=EB=A6=B4=EB=A6=AC=EC=A6=88=20?= =?UTF-8?q?=EB=85=B8=ED=8A=B8=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/RELEASE-NOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/RELEASE-NOTES.md b/docs/RELEASE-NOTES.md index a55b0c3..2c1e1b3 100644 --- a/docs/RELEASE-NOTES.md +++ b/docs/RELEASE-NOTES.md @@ -5,6 +5,7 @@ ## [Unreleased] ### 수정 +- 지도: S57 ENC 오버레이 스타일 로드 완료 대기 후 레이어 추가 - 지도: S57EncOverlay API URL을 공유 API_BASE_URL로 통합 - 지도: S57 ENC sprite URL에 상대경로일 때 origin 프리픽스 추가 - 지도: S57 ENC 오버레이 타일/sprite/glyphs URL을 절대경로로 변환 (운영환경 상대경로 대응) -- 2.45.2