From 20fa32cc5819fbea00e4c88a1135cc176807e881 Mon Sep 17 00:00:00 2001 From: yschoi Date: Fri, 2 May 2025 17:36:23 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8B=9C=EC=84=A4=20=EC=83=81=EC=84=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business_components/src/ui/map/Gis.js | 18 +++++------------- .../src/ui/map/GisContent.js | 9 ++++----- .../src/ui/map/GisSelect.js | 9 +++++++-- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/packages/common/business_components/src/ui/map/Gis.js b/packages/common/business_components/src/ui/map/Gis.js index a73467bb6..6f220b480 100644 --- a/packages/common/business_components/src/ui/map/Gis.js +++ b/packages/common/business_components/src/ui/map/Gis.js @@ -10,11 +10,7 @@ import proj4 from 'proj4'; import { register } from 'ol/proj/proj4'; import GisApp from './lib/gis.core'; import GisContent from './GisContent'; -import GisLonLat from './GisLonLat'; -import GisToolBar from './GisToolBar'; -import GisSelect from './GisSelect'; import GisTab from './GisTab'; -import MapToggleBtn from './MapToggleBtn'; import FeatureClickEventPopup from '@/map/featureClickEventPopup'; export const GisContext = createContext({gisCore: null, gisMap: null, treeData:null}); @@ -140,19 +136,15 @@ function Gis({ treeData = [], isSearch = false }) { <>
- - {isOpen && featureData && ( - - )} + /> + )}
- - - - + +
diff --git a/packages/common/business_components/src/ui/map/GisContent.js b/packages/common/business_components/src/ui/map/GisContent.js index 686a3ae70..93edcd12c 100644 --- a/packages/common/business_components/src/ui/map/GisContent.js +++ b/packages/common/business_components/src/ui/map/GisContent.js @@ -8,7 +8,7 @@ import './lib/css/gis.edit.css'; import MapToggleBtn from './MapToggleBtn'; import GisEdit from './GisEdit'; -export default function GisContent({ edit = false,onFeatureSelect }) { +export default function GisContent({ edit = false, onFeatureSelect }) { const { gisMap, gisCore } = useGisContext(); const [visibleComponents, setVisibleComponents] = useState({}); const addressResultLayer = useRef(null); @@ -51,11 +51,10 @@ export default function GisContent({ edit = false,onFeatureSelect }) { return ( <> {/**/} - {/* */} - {/* { */} - {/* */} + + + - {/* {edit && } */} ); } diff --git a/packages/common/business_components/src/ui/map/GisSelect.js b/packages/common/business_components/src/ui/map/GisSelect.js index 403db0413..365fffaa2 100644 --- a/packages/common/business_components/src/ui/map/GisSelect.js +++ b/packages/common/business_components/src/ui/map/GisSelect.js @@ -7,6 +7,7 @@ export default React.memo(function GisSelect({ onFeatureSelect }) { const { gisMap } = useContext(GisContext); + // useEffect(() => { // if (!gisMap) return; // 아직 초기화 안 됐으면 아무것도 안 함 @@ -15,10 +16,14 @@ export default React.memo(function GisSelect({ onFeatureSelect }) { // select.getSelectedInfo(function (features) { // if (features?.[0]) { - // onFeatureClick?.(features[0]); // props로 넘긴 함수 실행 + // // onFeatureClick?.(features[0]); // props로 넘긴 함수 실행 + // onFeatureSelect(layer.getProperties()); //피쳐 속성데이터 상위컴포넌트로 전달 // } // }); - // }, [gisMap, onFeatureClick]); + // }, [gisMap, onFeatureSelect]); + + const select = new GisOlSelect(gisMap); + GisApp.Module.select = select; select.getSelectedInfo(function (features) { //clickFeature(features[0]);