From 59cc416eaaa833851ce583d1645dbe371a9037a2 Mon Sep 17 00:00:00 2001 From: yschoi Date: Thu, 5 Jun 2025 13:14:36 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8C=8C=EC=9D=BC=EB=AA=85=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/sn/app/map/page.tsx | 14 ++--- .../business_components/src/ui/map/Gis.js | 2 +- .../src/ui/map/GisContent.js | 4 +- .../map/{MapToggleBtn.js => GisMapToggle.js} | 0 .../src/ui/map/Google3DMap.js | 60 ------------------- 5 files changed, 8 insertions(+), 72 deletions(-) rename packages/common/business_components/src/ui/map/{MapToggleBtn.js => GisMapToggle.js} (100%) delete mode 100644 packages/common/business_components/src/ui/map/Google3DMap.js diff --git a/apps/sn/app/map/page.tsx b/apps/sn/app/map/page.tsx index b547fb7e4..da20fdaa7 100644 --- a/apps/sn/app/map/page.tsx +++ b/apps/sn/app/map/page.tsx @@ -1,18 +1,14 @@ -'use client' +"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 Gis from "@common/business_components/ui/map/Gis"; import { useEffect, useState } from "react"; import { mapService } from "@service"; const Map = () => { - const [treeData, setTreeData] = useState([]); // 초기값을 객체 또는 null로 설정 - const [selectedFeature,setSelectedFeature] = useState(null); // 선택된 피처 상태 + const [selectedFeature, setSelectedFeature] = useState(null); // 선택된 피처 상태 - const fetchData = async () => { + const fetchData = async () => { try { const response = await mapService.getLyrStngs(); setTreeData(response.data); // API 응답 저장 @@ -29,7 +25,7 @@ const Map = () => { return (
-
+ ); }; diff --git a/packages/common/business_components/src/ui/map/Gis.js b/packages/common/business_components/src/ui/map/Gis.js index fd86a25b0..c501302f6 100644 --- a/packages/common/business_components/src/ui/map/Gis.js +++ b/packages/common/business_components/src/ui/map/Gis.js @@ -224,7 +224,7 @@ function Gis({ treeData = [], isSearch = false }) {
{/* - */} + */}
diff --git a/packages/common/business_components/src/ui/map/GisContent.js b/packages/common/business_components/src/ui/map/GisContent.js index ad8a53605..6f86c4435 100644 --- a/packages/common/business_components/src/ui/map/GisContent.js +++ b/packages/common/business_components/src/ui/map/GisContent.js @@ -5,7 +5,7 @@ import GisLonLat from './GisLonLat'; import GisSelect from './GisSelect'; import GisToolBar from './GisToolBar'; import './lib/css/gis.edit.css'; -import MapToggleBtn from './MapToggleBtn'; +import GisMapToggle from './GisMapToggle'; import { Search } from 'lucide-react'; export default function GisContent({ edit = false, onFeatureSelect, isSearch, setIsSearchModalOpen }) { @@ -51,7 +51,7 @@ export default function GisContent({ edit = false, onFeatureSelect, isSearch, se return ( <> {/**/} - + diff --git a/packages/common/business_components/src/ui/map/MapToggleBtn.js b/packages/common/business_components/src/ui/map/GisMapToggle.js similarity index 100% rename from packages/common/business_components/src/ui/map/MapToggleBtn.js rename to packages/common/business_components/src/ui/map/GisMapToggle.js diff --git a/packages/common/business_components/src/ui/map/Google3DMap.js b/packages/common/business_components/src/ui/map/Google3DMap.js deleted file mode 100644 index 2ae6547dd..000000000 --- a/packages/common/business_components/src/ui/map/Google3DMap.js +++ /dev/null @@ -1,60 +0,0 @@ -import React, { useEffect, useRef, useState } from 'react'; -import OLCesium from 'olcs/OLCesium'; -import olView from 'ol/View.js'; -import olSourceImageWMS from 'ol/source/ImageWMS.js'; -import olSourceOSM from 'ol/source/OSM.js'; -import olLayerImage from 'ol/layer/Image.js'; -import olLayerTile from 'ol/layer/Tile.js'; -import olMap from 'ol/Map.js'; -import { GLOBAL } from '../../js/consts/global'; - -const Google3DMap = () => { - const mapRef = useRef(null); - const [ol3d, setOl3d] = useState(null); - - useEffect(() => { - if (!mapRef.current) return; - - const customProjSource = new olSourceImageWMS({ - attributions: '© National parks / geo.admin.ch', - crossOrigin: 'anonymous', - params: { LAYERS: 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung' }, - projection: 'EPSG:21781', - url: 'https://wms.geo.admin.ch/', - }); - - const { Cesium } = window; - Cesium.Ion.defaultAccessToken = GLOBAL.CESIUM_ION_TOKEN; - - const ol2d = new olMap({ - layers: [new olLayerTile({ source: new olSourceOSM() }), new olLayerImage({ source: customProjSource })], - target: mapRef.current, - view: new olView({ - center: [860434.6266531206, 6029479.0044273855], - zoom: 6, - }), - }); - - const ol3dInstance = new OLCesium({ - map: ol2d, - time: () => Cesium.JulianDate.now(), - }); - - const scene = ol3dInstance.getCesiumScene(); - Cesium.createWorldTerrainAsync().then(tp => { - scene.terrainProvider = tp; - }); - - ol3dInstance.setEnabled(true); - setOl3d(ol3dInstance); - - return () => { - ol3dInstance.setEnabled(false); - ol2d.setTarget(null); - }; - }, []); - - return
; -}; - -export default Google3DMap;