From dafd6cc1ac53168bddd0aa5ecbad6cd6a868d6a3 Mon Sep 17 00:00:00 2001 From: "jeonghyo.k" Date: Wed, 1 Apr 2026 09:15:58 +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=ED=83=80=EC=9D=BC/sprite/glyphs=20URL?= =?UTF-8?q?=EC=9D=84=20=EC=A0=88=EB=8C=80=EA=B2=BD=EB=A1=9C=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/settings.json | 24 +------------------ .../common/components/map/S57EncOverlay.tsx | 15 ++++++------ .../reports/components/OilSpreadMapPanel.tsx | 2 +- 3 files changed, 10 insertions(+), 31 deletions(-) diff --git a/.claude/settings.json b/.claude/settings.json index 868df2d..441dc35 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -5,29 +5,7 @@ }, "permissions": { "allow": [ - "Bash(npm run *)", - "Bash(npm install *)", - "Bash(npm test *)", - "Bash(npx *)", - "Bash(node *)", - "Bash(git status)", - "Bash(git diff *)", - "Bash(git log *)", - "Bash(git branch *)", - "Bash(git checkout *)", - "Bash(git add *)", - "Bash(git commit *)", - "Bash(git pull *)", - "Bash(git fetch *)", - "Bash(git merge *)", - "Bash(git stash *)", - "Bash(git remote *)", - "Bash(git config *)", - "Bash(git rev-parse *)", - "Bash(git show *)", - "Bash(git tag *)", - "Bash(curl -s *)", - "Bash(fnm *)" + "Bash(*)" ], "deny": [ "Bash(git push --force*)", diff --git a/frontend/src/common/components/map/S57EncOverlay.tsx b/frontend/src/common/components/map/S57EncOverlay.tsx index 4384d45..692f336 100644 --- a/frontend/src/common/components/map/S57EncOverlay.tsx +++ b/frontend/src/common/components/map/S57EncOverlay.tsx @@ -3,6 +3,10 @@ import { useMap } from '@vis.gl/react-maplibre'; import { API_BASE_URL } from '../../services/api'; const PROXY_PREFIX = `${API_BASE_URL}/tiles/enc`; +// MapLibre 내부 요청(sprite, tiles, glyphs)은 절대 URL이 필요 +const ABSOLUTE_PREFIX = API_BASE_URL.startsWith('http') + ? `${API_BASE_URL}/tiles/enc` + : `${window.location.origin}${API_BASE_URL}/tiles/enc`; const ENC_SPRITE_ID = 'enc-s57'; const ENC_SOURCE_ID = 'enc-s57'; @@ -154,14 +158,11 @@ export function S57EncOverlay({ visible }: S57EncOverlayProps) { // eslint-disable-next-line @typescript-eslint/no-explicit-any const styleObj = map.style as any; originalGlyphsRef.current = styleObj.glyphs; - styleObj.glyphs = `${PROXY_PREFIX}/font/{fontstack}/{range}`; + styleObj.glyphs = `${ABSOLUTE_PREFIX}/font/{fontstack}/{range}`; // sprite 등록 (중복 방지) if (!hasSprite(map, ENC_SPRITE_ID)) { - const spriteUrl = PROXY_PREFIX.startsWith('http') - ? `${PROXY_PREFIX}/sprite/sprite` - : `${window.location.origin}${PROXY_PREFIX}/sprite/sprite`; - map.addSprite(ENC_SPRITE_ID, spriteUrl); + map.addSprite(ENC_SPRITE_ID, `${ABSOLUTE_PREFIX}/sprite/sprite`); } // sources 등록 (타일 URL을 프록시로 치환) @@ -169,7 +170,7 @@ export function S57EncOverlay({ visible }: S57EncOverlayProps) { const globeSrc = style.sources['globe']; map.addSource(GLOBE_SOURCE_ID, { type: 'vector', - tiles: [`${PROXY_PREFIX}/globe/{z}/{x}/{y}`], + tiles: [`${ABSOLUTE_PREFIX}/globe/{z}/{x}/{y}`], minzoom: globeSrc?.minzoom ?? 0, maxzoom: globeSrc?.maxzoom ?? 4, }); @@ -179,7 +180,7 @@ export function S57EncOverlay({ visible }: S57EncOverlayProps) { const encSrc = style.sources['enc']; map.addSource(ENC_SOURCE_ID, { type: 'vector', - tiles: [`${PROXY_PREFIX}/{z}/{x}/{y}`], + tiles: [`${ABSOLUTE_PREFIX}/{z}/{x}/{y}`], minzoom: encSrc?.minzoom ?? 4, maxzoom: encSrc?.maxzoom ?? 17, }); diff --git a/frontend/src/tabs/reports/components/OilSpreadMapPanel.tsx b/frontend/src/tabs/reports/components/OilSpreadMapPanel.tsx index 06167f8..763e796 100644 --- a/frontend/src/tabs/reports/components/OilSpreadMapPanel.tsx +++ b/frontend/src/tabs/reports/components/OilSpreadMapPanel.tsx @@ -46,7 +46,7 @@ const MapSlot = ({ label, step, mapData, captured, onCapture, onReset }: MapSlot {/* 지도 + 캡처 오버레이 */} -
+
Date: Wed, 1 Apr 2026 09:17:03 +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 9d3ea14..a55b0c3 100644 --- a/docs/RELEASE-NOTES.md +++ b/docs/RELEASE-NOTES.md @@ -7,6 +7,7 @@ ### 수정 - 지도: S57EncOverlay API URL을 공유 API_BASE_URL로 통합 - 지도: S57 ENC sprite URL에 상대경로일 때 origin 프리픽스 추가 +- 지도: S57 ENC 오버레이 타일/sprite/glyphs URL을 절대경로로 변환 (운영환경 상대경로 대응) ## [2026-03-31.2]