From b68e492dce9fd247095c45c8d80d74270db4da3f Mon Sep 17 00:00:00 2001 From: hagjoon Date: Fri, 26 Aug 2022 14:22:45 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[=EA=B8=B0=EC=B2=B4=EB=93=B1=EB=A1=9D]=20cr?= =?UTF-8?q?eate=20=EC=8B=9C=20=EC=82=AD=EC=A0=9C=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EB=B9=84=ED=99=9C=EC=84=B1=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basis/dron/BasisDronDetailContainer.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/containers/basis/dron/BasisDronDetailContainer.js b/src/containers/basis/dron/BasisDronDetailContainer.js index 53213099..6a1177b1 100644 --- a/src/containers/basis/dron/BasisDronDetailContainer.js +++ b/src/containers/basis/dron/BasisDronDetailContainer.js @@ -179,9 +179,17 @@ export const BasisDronDetailContainer = props => { > 저장 - - 삭제 - + {pageType != 'create'? + ( + + 삭제 + + ) + : + ( + <> + ) + } From b2651f24c9ab2a34ba3fd5e00f9a38f69899fa74 Mon Sep 17 00:00:00 2001 From: sanguu Date: Fri, 26 Aug 2022 17:09:31 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EB=B9=84=ED=96=89=EA=B3=84=ED=9A=8D?= =?UTF-8?q?=EC=84=9C=20=EC=A7=80=EB=8F=84(=EB=94=94=ED=8F=B4=ED=8A=B8=20?= =?UTF-8?q?=EC=B5=9C=EC=A2=85)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basis/flight/plan/FlightPlanAreaMap.js | 70 +++++++++---------- 1 file changed, 32 insertions(+), 38 deletions(-) diff --git a/src/components/basis/flight/plan/FlightPlanAreaMap.js b/src/components/basis/flight/plan/FlightPlanAreaMap.js index 4112baf5..04300b10 100644 --- a/src/components/basis/flight/plan/FlightPlanAreaMap.js +++ b/src/components/basis/flight/plan/FlightPlanAreaMap.js @@ -14,8 +14,7 @@ import { AREA_COORDINATE_LIST_SAVE } from '../../../../modules/basis/flight/acti const FlightPlanAreaMap = (props) => { const dispatch = useDispatch(); const naver = window.naver; - const airArea = props.airArea; - const isFlightDone = props.isFlightDone; + const airArea = props.airArea; const mapControl = useSelector(state => state.controlMapReducer); const { areaCoordList } = useSelector(state => state.flightState); @@ -24,9 +23,10 @@ const FlightPlanAreaMap = (props) => { const [mode, setMode] = useState(); const [mapAreaCoordList, setMapAreaCoordList] = useState(initFlightBas.initDetail.areaList); - useEffect(() => { + + useEffect(() => { NaverMapInit(); - }, []); + },[]); useEffect(() => { setIsMapLoad(true); @@ -38,41 +38,40 @@ const FlightPlanAreaMap = (props) => { }, [mapControl.drawType]); useEffect(() => { - // NaverMapInit(); + if(areaCoordList) { + if(areaCoordList[0].coordList[0].lat !== 0 && areaCoordList[0].coordList[0].lon !== 0){ + if(map) { + map.setCenter(new naver.maps.LatLng(areaCoordList[0].coordList[0].lat, areaCoordList[0].coordList[0].lon)) + } + } + } setMapAreaCoordList(areaCoordList) }, [areaCoordList]); - const ModeInit = () => { setMode(mapControl.drawType) } - + const NaverMapInit = () => { - const center = {}; const bufferzoom ={}; - if(areaCoordList) { - center.lat = areaCoordList[0].coordList[0].lat === 0 ? 37.520357 : areaCoordList[0].coordList[0].lat; - center.lon = areaCoordList[0].coordList[0].lon === 0 ? 126.610166 : areaCoordList[0].coordList[0].lon; - if(areaCoordList[0].bufferZone>=0 && areaCoordList[0].bufferZone<2000){ - bufferzoom.bufferzoom =13; - } - else if(areaCoordList[0].bufferZone>=2000 && areaCoordList[0].bufferZone <5000){ - bufferzoom.bufferzoom =12; - } - else if(areaCoordList[0].bufferZone>=5000 && areaCoordList[0].bufferZone <=9000){ - bufferzoom.bufferzoom =11; - } - else{ - bufferzoom.bufferzoom =10; - } - } - console.log("bufferzoom>>",bufferzoom); - console.log(center); - const mapOptions2 = { + if(areaCoordList){ + if(areaCoordList[0].bufferZone>=0 && areaCoordList[0].bufferZone <2000){ + bufferzoom.bufferzoom =13; + } + else if(areaCoordList[0].bufferZone>=2000 && areaCoordList[0].bufferZone <5000){ + bufferzoom.bufferzoom =12; + } + else if(areaCoordList[0].bufferZone>=5000 && areaCoordList[0].bufferZone <=9000){ + bufferzoom.bufferzoom =11; + } + else{ + bufferzoom.bufferzoom =10; + } + } + const mapOptions = { // center: new naver.maps.LatLng(36.56793936069445, 127.85101412107547), - center: new naver.maps.LatLng(center.lat, center.lon), - // zoom: 10, - zoom: bufferzoom.bufferzoom, + center: new naver.maps.LatLng(37.520357, 126.610166), + zoom: !areaCoordList ? 13 : bufferzoom.bufferzoom, zoomControl: true, mapTypeId: naver.maps.MapTypeId.NORMAL, zoomControlOptions: { @@ -80,9 +79,9 @@ const FlightPlanAreaMap = (props) => { style: naver.maps.ZoomControlStyle.SMALL } }; - setMap(new naver.maps.Map('map', mapOptions2)); + setMap(new naver.maps.Map('map', mapOptions)); } - + const handlerDrawType = val => { dispatch(drawTypeChangeAction(val)); }; @@ -142,7 +141,6 @@ const FlightPlanAreaMap = (props) => { handleCoordinates={handleCoordinates} handleInitCoordinates={handleInitCoordinates} handleConfirm={props.handleConfirm} - isFlightDone={isFlightDone} /> : null} {/* { handlerDrawType('RESET')} - {...(isFlightDone)? {disabled:true} : {} } + onClick={e => handlerDrawType('RESET')} > 초기화 @@ -173,7 +170,6 @@ const FlightPlanAreaMap = (props) => { className='mr-1' color='primary' onClick={e => handlerDrawType('LINE')} - {...(isFlightDone)? {disabled:true} : {} } > WayPoint @@ -181,14 +177,12 @@ const FlightPlanAreaMap = (props) => { className='mr-1' color='primary' onClick={e => handlerDrawType('CIRCLE')} - {...(isFlightDone)? {disabled:true} : {} } > Circle handlerDrawType('POLYGON')} - {...(isFlightDone)? {disabled:true} : {} } > Polygon