Browse Source

비행구역 - 좌표 수정 시 이동현상 수정

pull/2/head
junh_eee(이준희) 2 years ago
parent
commit
cf8aa1f906
  1. 13
      src/components/basis/flight/plan/FlightPlanAreaMap.js

13
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,6 +68,7 @@ const FlightPlanAreaMap = props => {
areaCoordList[0].coordList[0].lat !== 0 &&
areaCoordList[0].coordList[0].lon !== 0
) {
if (number === 0) {
if (map) {
map.setCenter(
new naver.maps.LatLng(
@ -73,11 +76,13 @@ const FlightPlanAreaMap = props => {
areaCoordList[0].coordList[0].lon
)
);
setMapAreaCoordList(areaCoordList);
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: {

Loading…
Cancel
Save