|
|
@ -7,6 +7,7 @@ import { InfoModal } from '../../../modal/InfoModal'; |
|
|
|
export const FlightPlanDraw = props => { |
|
|
|
export const FlightPlanDraw = props => { |
|
|
|
const dispatch = useDispatch(); |
|
|
|
const dispatch = useDispatch(); |
|
|
|
const mapControl = useSelector(state => state.controlMapReducer); |
|
|
|
const mapControl = useSelector(state => state.controlMapReducer); |
|
|
|
|
|
|
|
const isFlightDone = props.isFlightDone; |
|
|
|
|
|
|
|
|
|
|
|
const [pastPolyline, setPolyline] = useState(); |
|
|
|
const [pastPolyline, setPolyline] = useState(); |
|
|
|
const [pastBuffer, setBuffer] = useState(); |
|
|
|
const [pastBuffer, setBuffer] = useState(); |
|
|
@ -611,6 +612,8 @@ export const FlightPlanDraw = props => { |
|
|
|
setPolyline(polyline) |
|
|
|
setPolyline(polyline) |
|
|
|
|
|
|
|
|
|
|
|
//dragCircle 생성
|
|
|
|
//dragCircle 생성
|
|
|
|
|
|
|
|
let clickSet; |
|
|
|
|
|
|
|
{isFlightDone? {clickSet:'false'} : {clickSet:'true'} } |
|
|
|
for(let i = 0; i < paths.length; i++) { |
|
|
|
for(let i = 0; i < paths.length; i++) { |
|
|
|
dragCircle.push( |
|
|
|
dragCircle.push( |
|
|
|
new naver.maps.Circle({ |
|
|
|
new naver.maps.Circle({ |
|
|
@ -621,12 +624,17 @@ export const FlightPlanDraw = props => { |
|
|
|
center: paths[i], |
|
|
|
center: paths[i], |
|
|
|
radius: 15, |
|
|
|
radius: 15, |
|
|
|
map: map, |
|
|
|
map: map, |
|
|
|
clickable: true |
|
|
|
clickable: clickSet |
|
|
|
}) |
|
|
|
}) |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
{isFlightDone ?
|
|
|
|
|
|
|
|
{} |
|
|
|
|
|
|
|
: |
|
|
|
dragCircleEve.push(naver.maps.Event.addListener(dragCircle[i], 'mousedown', function () { onMouseDownDrag(i) })) |
|
|
|
dragCircleEve.push(naver.maps.Event.addListener(dragCircle[i], 'mousedown', function () { onMouseDownDrag(i) })) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
setDragCircle(dragCircle); |
|
|
|
setDragCircle(dragCircle); |
|
|
|
|
|
|
|
|
|
|
|
//bufferline 생성
|
|
|
|
//bufferline 생성
|
|
|
@ -713,6 +721,8 @@ export const FlightPlanDraw = props => { |
|
|
|
setPolygon(polygon); |
|
|
|
setPolygon(polygon); |
|
|
|
|
|
|
|
|
|
|
|
//dragCircle 생성
|
|
|
|
//dragCircle 생성
|
|
|
|
|
|
|
|
let clickSet; |
|
|
|
|
|
|
|
{isFlightDone? {clickSet:'false'} : {clickSet:'true'} } |
|
|
|
for(let i = 0; i < paths.length; i++) { |
|
|
|
for(let i = 0; i < paths.length; i++) { |
|
|
|
dragCircle.push( |
|
|
|
dragCircle.push( |
|
|
|
new naver.maps.Circle({ |
|
|
|
new naver.maps.Circle({ |
|
|
@ -723,11 +733,15 @@ export const FlightPlanDraw = props => { |
|
|
|
center: paths[i], |
|
|
|
center: paths[i], |
|
|
|
radius: 15, |
|
|
|
radius: 15, |
|
|
|
map: map, |
|
|
|
map: map, |
|
|
|
clickable: true |
|
|
|
clickable: clickSet |
|
|
|
}) |
|
|
|
}) |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
{isFlightDone ? |
|
|
|
|
|
|
|
{} |
|
|
|
|
|
|
|
: |
|
|
|
dragCircleEve.push(naver.maps.Event.addListener(dragCircle[i], 'mousedown', function () { onMouseDownDrag(i) })) |
|
|
|
dragCircleEve.push(naver.maps.Event.addListener(dragCircle[i], 'mousedown', function () { onMouseDownDrag(i) })) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
setDragCircle(dragCircle); |
|
|
|
setDragCircle(dragCircle); |
|
|
|
|
|
|
|
|
|
|
@ -807,6 +821,8 @@ export const FlightPlanDraw = props => { |
|
|
|
pastCircle.forEach(prev => prev.setMap(null)); |
|
|
|
pastCircle.forEach(prev => prev.setMap(null)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let clickSet; |
|
|
|
|
|
|
|
{isFlightDone? {clickSet:'false'} : {clickSet:'true'} } |
|
|
|
circle = new naver.maps.Circle({ |
|
|
|
circle = new naver.maps.Circle({ |
|
|
|
strokeColor: '#283046', |
|
|
|
strokeColor: '#283046', |
|
|
|
strokeOpacity: 1, |
|
|
|
strokeOpacity: 1, |
|
|
@ -816,9 +832,13 @@ export const FlightPlanDraw = props => { |
|
|
|
center: paths[0], |
|
|
|
center: paths[0], |
|
|
|
radius: areas.bufferZone, |
|
|
|
radius: areas.bufferZone, |
|
|
|
map: map, |
|
|
|
map: map, |
|
|
|
clickable: true |
|
|
|
clickable: clickSet |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
{isFlightDone ? |
|
|
|
|
|
|
|
{} |
|
|
|
|
|
|
|
: |
|
|
|
Eve.mousedownEve = naver.maps.Event.addListener(circle, 'mousedown', function () { onMouseDownDrag(0); }) |
|
|
|
Eve.mousedownEve = naver.maps.Event.addListener(circle, 'mousedown', function () { onMouseDownDrag(0); }) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
setCircle([circle]); |
|
|
|
setCircle([circle]); |
|
|
|
|
|
|
|
|
|
|
|