|
|
|
@ -124,9 +124,9 @@ export const LaancDrawControl = props => {
|
|
|
|
|
// 도형 그리기 완료 시
|
|
|
|
|
// drawType을 바꾸면 종료처리가 돼서 이게 실행되는 듯
|
|
|
|
|
const handlerDblClickFinish = state => { |
|
|
|
|
const mode = handlerReturnMode(drawObj.getMode()); |
|
|
|
|
if (state.currentVertexPosition !== 0) { |
|
|
|
|
console.log('dblclick'); |
|
|
|
|
const mode = handlerReturnMode(drawObj.getMode()); |
|
|
|
|
|
|
|
|
|
if (mode === 'CIRCLE') { |
|
|
|
|
const obj = state.polygon; |
|
|
|
@ -135,6 +135,9 @@ export const LaancDrawControl = props => {
|
|
|
|
|
radius: obj.properties.radiusInKm * 1000, |
|
|
|
|
id: obj.id |
|
|
|
|
}; |
|
|
|
|
// 임시 데이터(circle 관제권 유무 판별 여기서 해줘야 함)
|
|
|
|
|
drawObj.setFeatureProperty(obj.id, 'inAirArea', 'N'); |
|
|
|
|
|
|
|
|
|
drawObj.setFeatureProperty(data.id, 'id', mode); |
|
|
|
|
handlerCreateOneMarker([0, -10], data.coord, data.radius, data.id); |
|
|
|
|
handlerAbnormalityCheck(data, mode); |
|
|
|
@ -189,6 +192,15 @@ export const LaancDrawControl = props => {
|
|
|
|
|
handlerAbnormalityCheck(data, mode); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// 좌표가 찍히기도 전에 틀만 생성된 도형들 삭제
|
|
|
|
|
if (mode === 'CIRCLE') { |
|
|
|
|
const obj = state.polygon; |
|
|
|
|
drawObj.delete(obj.id); |
|
|
|
|
} else { |
|
|
|
|
const obj = state[mode.toLowerCase()]; |
|
|
|
|
drawObj.delete(obj.id); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -347,9 +359,8 @@ export const LaancDrawControl = props => {
|
|
|
|
|
|
|
|
|
|
const viewCoordObj = drawObj |
|
|
|
|
.getAll() |
|
|
|
|
.features.filter( |
|
|
|
|
o => o.geometry.coordinates.length > 0 && o.properties.id !== 'BUFFER' |
|
|
|
|
); |
|
|
|
|
.features.filter(o => o.properties?.inAirArea); |
|
|
|
|
|
|
|
|
|
props.setViewCoordObj(viewCoordObj); |
|
|
|
|
|
|
|
|
|
if (viewCoordObj.length > 1) { |
|
|
|
@ -542,6 +553,7 @@ export const LaancDrawControl = props => {
|
|
|
|
|
const drawInit = () => { |
|
|
|
|
const mode = mapControl.drawType; |
|
|
|
|
if (mode !== 'DONE') { |
|
|
|
|
// console.log(mode, 'mode----');
|
|
|
|
|
if (!props.addData.isAddable) { |
|
|
|
|
// 추가 상태가 아닐 때
|
|
|
|
|
drawObj.deleteAll(); |
|
|
|
|