From af8b0cebb4824ceb094db66bb441aaacecdabea2 Mon Sep 17 00:00:00 2001 From: kimjh2369 Date: Mon, 19 Sep 2022 15:51:30 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=84=ED=96=89=20=EA=B5=AC=EC=97=AD=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EC=A4=91=EB=B3=B5=20=EC=A2=8C=ED=91=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basis/flight/plan/FlightPlanAreaMap.js | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/components/basis/flight/plan/FlightPlanAreaMap.js b/src/components/basis/flight/plan/FlightPlanAreaMap.js index 93778b7..472e4e3 100644 --- a/src/components/basis/flight/plan/FlightPlanAreaMap.js +++ b/src/components/basis/flight/plan/FlightPlanAreaMap.js @@ -8,8 +8,11 @@ import { } from '../../../../modules/control/map/actions/controlMapActions'; import { FlightPlanDraw } from '../../../map/naver/draw/FlightPlanDraw'; import { initFlightBas } from '../../../../modules/basis/flight/models/basisFlightModel'; -import { AREA_COORDINATE_LIST_SAVE } from '../../../../modules/basis/flight/actions/basisFlightAction'; -import {flightPlanAPI} from '../../../../modules/basis/flight/apis/basisFlightApi' +import { + AREA_COORDINATE_LIST_SAVE, + AREA_DETAIL_INIT +} from '../../../../modules/basis/flight/actions/basisFlightAction'; +import { flightPlanAPI } from '../../../../modules/basis/flight/apis/basisFlightApi'; const FlightPlanAreaMap = props => { const dispatch = useDispatch(); @@ -29,6 +32,9 @@ const FlightPlanAreaMap = props => { useEffect(() => { NaverMapInit(); + return () => { + dispatch(AREA_DETAIL_INIT()); + }; }, []); useEffect(() => { @@ -56,7 +62,7 @@ const FlightPlanAreaMap = props => { } } } - }, [areaCoordList]); + }, [areaCoordList, map]); const ModeInit = () => { setMode(mapControl.drawType); @@ -136,10 +142,9 @@ const FlightPlanAreaMap = props => { setMapAreaCoordList(areaList); }; - const handleSearch = async() => { - const res = await flightPlanAPI.searchArea({query: query}); - console.log(res.data.items, '<<<') - } + const handleSearch = async () => { + const res = await flightPlanAPI.searchArea({ query: query }); + }; const handleChange = e => { const { name, value } = e.target; @@ -246,12 +251,12 @@ const FlightPlanAreaMap = props => { // {...props.test? ( // {} // ):( - // {disabled:false} - // )} - disabled={props.test} - > + // {disabled:false} + // )} + disabled={props.test} + > 초기화 - +