diff --git a/apps/sn/app/map/featureClickEventPopup.tsx b/apps/sn/app/map/featureClickEventPopup.tsx index 6dd573732..54de59668 100644 --- a/apps/sn/app/map/featureClickEventPopup.tsx +++ b/apps/sn/app/map/featureClickEventPopup.tsx @@ -19,6 +19,7 @@ const FeatureClickEventPopup = ({ onClose, featureData }: { onClose: () => void, const { gisMap } = useGisContext() as unknown as { checkedLayerIds: React.MutableRefObject; treeData: { lyrSn: number }[] | null; gisCore: any; gisMap: any; }; const featureId = featureData.getId(); // 피처의 속성 가져오기 const [layerNm, setLayerNm] = useState(""); // 레이어 이름 상태 + const [tableData, setTableData] = useState(null); // 피처 데이터 상태 // 피쳐데이터의 현재 레이어 이름 가져오는 함수 const getSelectedLayers = () => { const layers = gisMap.getLayers().getArray(); // gisMap에서 모든 레이어 가져오기 @@ -62,21 +63,16 @@ const FeatureClickEventPopup = ({ onClose, featureData }: { onClose: () => void, updateData(inspectionData, setInspectionData); } }; - async function transformFeatureDataToArray(featureId: any, keys: string[]) { - const data = await getData(`v1/map/features/${featureId}`); - // 필요한 키만 추출하여 새로운 객체 생성 - console.log("data", data); - const transformedData = keys.reduce((acc, key) => { - acc[key] = data[key] !== undefined ? data[key] : "N/A"; // 값이 없으면 "N/A"로 처리 - return acc; - }, {} as Record); - - // 배열로 감싸서 반환 - return [transformedData]; - } - const keys = SwtrmtFcltCol.map((column) => column.id); - const transformedFeatureData = transformFeatureDataToArray(featureId, keys); - useEffect(() => { setLayerNm(getSelectedLayers()) }, [featureId]); + useEffect(() => { + // const fetchData = async () => { + // if (featureId) { + setLayerNm(getSelectedLayers()); + // } + // const data = await getData(`v1/map/features/${featureId}`); + // setTableData(data); + // }; + // fetchData(); + }, [featureId]); const renderSection = (title: string, data: { year: string; type: string }[], sectionKey: string) => (
{/* 섹션 제목 */} @@ -127,7 +123,7 @@ const FeatureClickEventPopup = ({ onClose, featureData }: { onClose: () => void,
-