From cf8aa1f9064205aa1073c5df73978e8a0534a953 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: Wed, 19 Oct 2022 11:13:32 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=84=ED=96=89=EA=B5=AC=EC=97=AD=20-=20?= =?UTF-8?q?=EC=A2=8C=ED=91=9C=20=EC=88=98=EC=A0=95=20=EC=8B=9C=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=ED=98=84=EC=83=81=20=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 | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/components/basis/flight/plan/FlightPlanAreaMap.js b/src/components/basis/flight/plan/FlightPlanAreaMap.js index 2fc6746f..33a0a068 100644 --- a/src/components/basis/flight/plan/FlightPlanAreaMap.js +++ b/src/components/basis/flight/plan/FlightPlanAreaMap.js @@ -38,9 +38,11 @@ const FlightPlanAreaMap = props => { const [searchRes, setSearchRes] = useState([]); const [isSearch, setIsSearch] = useState(false); - const [dragSize, setDragSize] = useState(140); + const [dragSize, setDragSize] = useState(70); const [pastDragCircle, setDragCircle] = useState([]); + const [number, setNumber] = useState(0); + useEffect(() => { NaverMapInit(); return () => { @@ -66,18 +68,21 @@ const FlightPlanAreaMap = props => { 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); + if (number === 0) { + if (map) { + map.setCenter( + new naver.maps.LatLng( + areaCoordList[0].coordList[0].lat, + areaCoordList[0].coordList[0].lon + ) + ); + setNumber(number + 1); + } } + setMapAreaCoordList(areaCoordList); } } - }, [areaCoordList, map]); + }, [areaCoordList, map, number]); const ModeInit = () => { setMode(mapControl.drawType); @@ -108,7 +113,7 @@ const FlightPlanAreaMap = props => { const mapOptions = { // center: new naver.maps.LatLng(36.56793936069445, 127.85101412107547), center: new naver.maps.LatLng(37.520357, 126.610166), - zoom: !areaCoordList ? 13 : bufferzoom.bufferzoom, + zoom: !areaCoordList ? 14 : bufferzoom.bufferzoom, zoomControl: true, mapTypeId: naver.maps.MapTypeId.NORMAL, zoomControlOptions: {