fix(map): S57 ENC �������� ��Ÿ�� �ε� �Ϸ� ���� �� ���̾� �߰� #155

병합
jhkang fix/s57-api-url 에서 develop 로 2 commits 를 머지했습니다 2026-04-01 19:12:31 +09:00
Showing only changes of commit 08bcfbf24d - Show all commits

파일 보기

@ -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]);