diff --git a/src/views/laanc/LaancStep1.js b/src/views/laanc/LaancStep1.js index 243ccf9..e97285f 100644 --- a/src/views/laanc/LaancStep1.js +++ b/src/views/laanc/LaancStep1.js @@ -1,4 +1,5 @@ import React, { useEffect, useState } from 'react'; +import { useHistory, useLocation } from 'react-router-dom'; import { Search } from 'react-feather'; import { BiBuildings, BiGridAlt } from 'react-icons/bi'; import { CgTrees } from 'react-icons/cg'; @@ -38,7 +39,6 @@ import { mapTypeChangeAction, sensorClickAction } from '../../modules/control/map/actions/controlMapActions'; -import { useHistory } from 'react-router-dom'; import FlightArea from './FlightArea'; import { AREA_DETAIL_INIT } from '../../modules/basis/flight/actions/basisFlightAction'; @@ -50,7 +50,8 @@ export default function LaancStep1({ disabledAnimation, setDisabledAnimation, centeredModal, - setCenteredModal + setCenteredModal, + currentParm }) { const { user } = useSelector(state => state.authState); const { areaCoordList } = useSelector(state => state.flightState); @@ -58,6 +59,15 @@ export default function LaancStep1({ const history = useHistory(); const dispatch = useDispatch(); + const location = useLocation(); + const queryParams = new URLSearchParams(location.search); + const mapParam = queryParams.get('map'); + + useEffect(() => { + // URL 쿼리 파라미터 중 'map' 값을 가져옵니다. + if (!currentParm) setCenteredModal(mapParam); + }, [location]); + useEffect(() => { return () => { dispatch(AREA_DETAIL_INIT()); @@ -342,10 +352,19 @@ export default function LaancStep1({ { + const { name, value } = e.target; + handleChange({ + type: 'arcrft', + name, + value + }); + }} >