|
|
|
@ -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: { |
|
|
|
|