레이어 컴포넌트 추가
iipbs_sn / build (push) Waiting to run

This commit is contained in:
JIeunhuh
2025-05-09 16:32:07 +09:00
parent e8c293a43b
commit bd1c758caa
2 changed files with 23 additions and 8 deletions
+5 -4
View File
@@ -3,12 +3,12 @@ import Ssc from "../popupComponent/Ssc";
import SwtrmtFclt from "../popupComponent/SwtrmtFclt";
// 레이어 이름과 컴포넌트를 매핑
const layerContentMap: { [key: string]: { component: React.FC<any>; props?: any; } } = {
const layerContentMap: { [key: string]: { component?: React.FC<any> ; props?: any; } } = {
// TODO: gis데이터 추가되면 추가 작업 필요
"하수처리시설": {
component: SwtrmtFclt,
},
"하수처리구역": { component: Ssc, },
"하수처리구역": { },
"중점우수토실":{component: Ssc,},
"하수관로":{component: SwtrmtFclt,},
"하수맨홀":{component: smh,},
@@ -17,8 +17,9 @@ const layerContentMap: { [key: string]: { component: React.FC<any>; props?: any;
// 동적 컴포넌트 반환 함수
export const getLayerContentComponent = (layerNm: string): React.FC => {
const component = layerContentMap[layerNm];
if (!component) {
throw new Error(`Component not found for layer name: ${layerNm}`);
if (!component || !component.component) {
// component가 없으면 null 반환
return () => null;
}
return component.component;
};