Browse Source

laanc 비행구역 비정상상황 예외처리

pull/2/head
junh_eee(이준희) 11 months ago
parent
commit
7524fc19e3
  1. 62
      src/components/map/mapbox/draw/LaancDrawControl.js

62
src/components/map/mapbox/draw/LaancDrawControl.js

@ -157,24 +157,36 @@ export const LaancDrawControl = props => {
drawObj.setFeatureProperty(newBufferId[0], 'lineId', obj.id);
setBufferId(newBufferId[0]);
if (length < 1) {
setAlertModal({
isOpen: true,
if (length < 2) {
// setAlertModal({
// isOpen: true,
// title: '좌표 최소 개수',
// desc: '좌표를 두 개 점으로 이어주세요.'
// });
props.setModal({
title: '좌표 최소 개수',
desc: '좌표를 두 개 점으로 이어주세요.'
desc: <>좌표를 점으로 이어주세요.</>,
isOpen: true
});
handlerRemoveError(obj.id);
return;
}
} else if (mode === 'POLYGON') {
obj.coordinates[0].splice(-1);
if (length < 2) {
setAlertModal({
isOpen: true,
if (length < 3) {
// setAlertModal({
// isOpen: true,
// title: '좌표 최소 개수',
// desc: '좌표를 세 개 점으로 이어주세요.'
// });
props.setModal({
title: '좌표 최소 개수',
desc: '좌표를 세 개 점으로 이어주세요.'
desc: <>좌표를 점으로 이어주세요.</>,
isOpen: true
});
handlerRemoveError(obj.id);
return;
}
}
const data = {
@ -282,20 +294,7 @@ export const LaancDrawControl = props => {
alert('에러 발생');
}
props.handlerCoordinates(areaInfo);
setIsDrawDone(true);
const viewCoordObj = drawObj
.getAll()
.features.filter(o => o.properties.id !== 'BUFFER');
props.setViewCoordObj(viewCoordObj);
if (viewCoordObj.length > 19) {
props.handlerAddChange('overAdd', true);
} else {
props.handlerAddChange('isViewAdd', true);
}
handlerSaveData(areaInfo);
};
// 비가시권 검사
@ -417,6 +416,25 @@ export const LaancDrawControl = props => {
props.setViewCoordObj(viewCoordObj);
};
// 정상 좌표 처리
const handlerSaveData = areaInfo => {
console.log('ok!!!');
props.handlerCoordinates(areaInfo);
setIsDrawDone(true);
const viewCoordObj = drawObj
.getAll()
.features.filter(o => o.properties.id !== 'BUFFER');
props.setViewCoordObj(viewCoordObj);
if (viewCoordObj.length > 19) {
props.handlerAddChange('overAdd', true);
} else {
props.handlerAddChange('isViewAdd', true);
}
};
// areaInfo 셋팅
const handlerSettingAreaInfo = data => {
if (!data.coord || !data.mode) {

Loading…
Cancel
Save