From 70b08c7b92c575361c4a577f0e29e4a2ccc4ee9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?junh=5Feee=28=EC=9D=B4=EC=A4=80=ED=9D=AC=29?= Date: Tue, 5 Dec 2023 13:59:44 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=84=ED=96=89=EA=B5=AC=EC=97=AD=20?= =?UTF-8?q?=EB=AF=B8=EC=82=AC=EC=9A=A9=20state,=20import=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/laanc/map/FlightArea.js | 43 ++++++++++++++---------- src/components/laanc/map/LaancAreaMap.js | 23 +++---------- 2 files changed, 30 insertions(+), 36 deletions(-) diff --git a/src/components/laanc/map/FlightArea.js b/src/components/laanc/map/FlightArea.js index 1325a5fc..98e957ec 100644 --- a/src/components/laanc/map/FlightArea.js +++ b/src/components/laanc/map/FlightArea.js @@ -27,7 +27,6 @@ import { handlerCreatePoint, handlerFitBounds, handlerGetCircleCoord, - handlerRemoveAllMarker, layerBuffer, layerPolygon, layerPolyline, @@ -36,13 +35,11 @@ import { import flatGimpo from '../../map/geojson/flatGimpoAirportAirArea.json'; import gimpo from '../../map/geojson/gimpoAirportAirArea.json'; import geoJson from '../../map/geojson/airArea.json'; -import axios from '../../../modules/utils/customAxiosUtil'; import { FeatureAirZone } from '../../map/mapbox/feature/FeatureAirZone'; import { WeatherContainer } from '../../../containers/basis/flight/plan/WeatherContainer'; import { initFlightBas } from '../../../modules/laanc/models/laancModels'; import * as LaancAction from '../../../modules/laanc/actions/laancActions'; import LaancDrawModal from './LaancDrawModal'; -import { handlerRemoveGroupMarker } from '../../../utility/DrawUtil'; const initialAddData = { isAddable: false, @@ -86,8 +83,6 @@ export default function FlightArea({ const [saveData, setSaveData] = useState(); const [saveElev, setSaveElev] = useState(); - // const [isDrawDone, setIsDrawDone] = useState(false); - //날씨 임시 데이터 const [wheather, setWheather] = useState([]); @@ -183,15 +178,6 @@ export default function FlightArea({ }; const handlerDrawType = val => { - // if (drawObj.getMode().includes('draw')) { - // const isEmpty = drawObj - // .getAll() - // .features.filter(o => !o.properties.id && o.properties.id !== 'BUFFER'); - // drawObj.delete(isEmpty[0].id); - // handlerRemoveGroupMarker(isEmpty[0].id); - // } - // dispatch(drawTypeChangeAction(val)); - if (drawObj.getMode().includes('draw')) { setModal({ title: '비행 구역 설정', @@ -265,6 +251,8 @@ export default function FlightArea({ 'all', ['==', '$type', 'LineString'], ['!=', 'mode', 'static'] + // ['==', 'meta', 'feature'], + // ['==', 'active', 'false'] ], layout: { 'line-cap': 'round', @@ -276,6 +264,26 @@ export default function FlightArea({ 'line-width': 2 } }, + // direct line stroke + // { + // id: 'gl-draw-line-active', + // type: 'line', + // filter: [ + // 'all', + // ['==', '$type', 'LineString'], + // ['==', 'meta', 'feature'], + // ['==', 'active', 'true'] + // ], + // layout: { + // 'line-cap': 'round', + // 'line-join': 'round' + // }, + // paint: { + // 'line-color': '#000000', + // 'line-dasharray': [0.2, 2], + // 'line-width': 2 + // } + // }, // polygon fill { id: 'gl-draw-polygon-fill', @@ -580,7 +588,10 @@ export default function FlightArea({ {page === 1 ? ( setCenteredModal(!centeredModal)} + toggle={() => { + setCenteredModal(!centeredModal); + dispatch(AREA_COORDINATE_LIST_SAVE(saveData)); + }} className='modal-dialog-centered modal-xl' > diff --git a/src/components/laanc/map/LaancAreaMap.js b/src/components/laanc/map/LaancAreaMap.js index 4750a1cc..f0f3af36 100644 --- a/src/components/laanc/map/LaancAreaMap.js +++ b/src/components/laanc/map/LaancAreaMap.js @@ -12,10 +12,7 @@ import { AREA_COORDINATE_LIST_SAVE, FLIGHT_PLAN_AREA_BUFFER_LIST } from '../../../modules/basis/flight/actions/basisFlightAction'; -import { - drawTypeChangeAction, - mapInitAction -} from '../../../modules/control/map/actions/controlMapActions'; +import { mapInitAction } from '../../../modules/control/map/actions/controlMapActions'; import { FormattingCoord, handlerFitBounds, @@ -44,8 +41,6 @@ export default function LaancAreaMap({ setSaveData, handlerSaveElev, setModal - // isDrawDone, - // setIsDrawDone }) { const dispatch = useDispatch(); const mapControl = useSelector(state => state.controlMapReducer); @@ -59,13 +54,8 @@ export default function LaancAreaMap({ ); const [number, setNumber] = useState(0); - // const [modal, setModal] = useState({ - // title: '', - // desc: '', - // isOpen: false - // }); - const [detailLayer, setDetailLayer] = useState(); + // const [detailLayer, setDetailLayer] = useState(); const [viewCoordObj, setViewCoordObj] = useState([]); @@ -265,8 +255,8 @@ export default function LaancAreaMap({ handlerCreateAirSpace(map); setIsMapLoad(true); - const detail = map.getSource('detail'); - if (detail) setDetailLayer(detail); + // const detail = map.getSource('detail'); + // if (detail) setDetailLayer(detail); }); setMapObject(map); dispatch(mapInitAction(map)); @@ -484,13 +474,8 @@ export default function LaancAreaMap({ setSaveData={setSaveData} handlerAreaInfoToAreaList={handlerAreaInfoToAreaList} handlerSaveElev={handlerSaveElev} - // isDrawDone={isDrawDone} - // setIsDrawDone={setIsDrawDone} /> - {/* {modal ? ( - - ) : null} */} ) : null}