37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
'use client'
|
|
|
|
import Gis from '@common/business_components/ui/map/Gis';
|
|
import { SearchDiv, SelectBox, UiTable, MainDiv, Title, ContentsDiv, SearchFormLeft, SearchFormRight } from '@common/business_components';
|
|
import ListDiv from '@common/business_components/ui/list_div';
|
|
import { Button, Input } from '@common/components';
|
|
import { useEffect, useState } from "react";
|
|
import { mapService } from "@service";
|
|
|
|
const Map = () => {
|
|
|
|
const [treeData, setTreeData] = useState([]); // 초기값을 객체 또는 null로 설정
|
|
const [selectedFeature,setSelectedFeature] = useState(null); // 선택된 피처 상태
|
|
|
|
const fetchData = async () => {
|
|
try {
|
|
const response = await mapService.getLyrStngs();
|
|
setTreeData(response.data); // API 응답 저장
|
|
} catch (error) {
|
|
console.error("데이터 불러오기 실패:", error);
|
|
}
|
|
};
|
|
|
|
// 컴포넌트 마운트 시 1회 실행
|
|
useEffect(() => {
|
|
fetchData();
|
|
}, []);
|
|
|
|
return (
|
|
<div className="bg-container">
|
|
<Gis treeData={treeData} isSearch={true} />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Map;
|