diff --git a/src/components/laanc/map/LaancAreaMap.js b/src/components/laanc/map/LaancAreaMap.js
index 0e55bf8b..2bf1e2a1 100644
--- a/src/components/laanc/map/LaancAreaMap.js
+++ b/src/components/laanc/map/LaancAreaMap.js
@@ -56,7 +56,11 @@ export default function LaancAreaMap({
);
const [number, setNumber] = useState(0);
- const [modal, setModal] = useState(false);
+ const [modal, setModal] = useState({
+ title: '',
+ desc: '',
+ isOpen: false
+ });
const [detailLayer, setDetailLayer] = useState();
diff --git a/src/components/map/mapbox/draw/LaancDrawControl.js b/src/components/map/mapbox/draw/LaancDrawControl.js
index 24d7a2d1..670e40c2 100644
--- a/src/components/map/mapbox/draw/LaancDrawControl.js
+++ b/src/components/map/mapbox/draw/LaancDrawControl.js
@@ -79,6 +79,17 @@ export const LaancDrawControl = props => {
const type = handlerReturnMode(drawObj.getMode());
const obj = state[type?.toLowerCase()];
+ // const features = mapObject.queryRenderedFeatures(e.point, {
+ // layers: ['maine']
+ // });
+ // if (features.length > 0 && obj) {
+ // if (features[0].properties.description.includes('김포공항 비행불가')) {
+ // if (!obj?.properties?.isUnable) {
+ // drawObj.setFeatureProperty(obj.id, 'isUnable', true);
+ // }
+ // }
+ // }
+
if (type && obj) {
const feature = drawObj.get(obj.id);
const coordinates = feature.geometry.coordinates;
@@ -236,8 +247,10 @@ export const LaancDrawControl = props => {
// 모든 비정상상황 체크
const handlerAbnormalityCheck = (data, mode) => {
- const isBreak = handlerIsSpecialFlight(data, mode);
- if (isBreak) return;
+ const isBreak1 = handlerIsSpecialFlight(data, mode);
+ const isBreak2 = handlerIsUnableArea(data, mode);
+ if (isBreak1) return;
+ if (isBreak2) return;
const initCoord =
mode === 'LINE'
@@ -252,7 +265,7 @@ export const LaancDrawControl = props => {
handlerSaveAreaInfo(datas);
};
- // 현재 그려진 모든 도형에 대한 비가시권 검사
+ // 비가시권 검사
const handlerIsSpecialFlight = (data, mode) => {
console.log('specialFlight');
let isBreak = false;
@@ -273,7 +286,66 @@ export const LaancDrawControl = props => {
}
if (isBreak) {
- props.setModal(true);
+ props.setModal({
+ title: '특별 비행 신청',
+ desc: (
+ <>
+ 육안으로 기체 확인이 불가능 합니다.
+
가시권 밖 범위는 특별비행 신청을 진행하셔야 합니다.
+ 드론원스톱을 통해서 신청해 주시기 바랍니다.
+ >
+ ),
+ isOpen: true
+ });
+ handlerRemoveError(data.id);
+ return true;
+ } else {
+ props.handlerSaveCheck(true);
+ return false;
+ }
+ };
+
+ // 비행불가지역 검사
+ const handlerIsUnableArea = (data, mode) => {
+ console.log('unableArea');
+ let isBreak = false;
+
+ if (mode === 'CIRCLE') {
+ const point = mapObject.project(data.coord);
+ const maine = mapObject.queryRenderedFeatures(point, {
+ layers: ['maine']
+ });
+
+ if (maine.length > 0) {
+ if (maine[0].properties.description.includes('김포공항 비행불가')) {
+ isBreak = true;
+ // break;
+ }
+ }
+ } else {
+ const coord = mode === 'LINE' ? data.coord : data.coord[0];
+
+ for (let i = 0; i < coord.length; i++) {
+ const point = mapObject.project(coord[i]);
+ const maine = mapObject.queryRenderedFeatures(point, {
+ layers: ['maine']
+ });
+
+ if (maine.length > 0) {
+ if (maine[0].properties.description.includes('김포공항 비행불가')) {
+ isBreak = true;
+ break;
+ }
+ }
+ }
+ }
+
+ if (isBreak) {
+ props.setModal({
+ title: '비행 불가 지역',
+ desc: <>비행불가!>,
+ isOpen: true
+ });
handlerRemoveError(data.id);
return true;
} else {
diff --git a/src/components/map/mapbox/draw/LaancModal.js b/src/components/map/mapbox/draw/LaancModal.js
index 66724b8b..c3761dc4 100644
--- a/src/components/map/mapbox/draw/LaancModal.js
+++ b/src/components/map/mapbox/draw/LaancModal.js
@@ -8,23 +8,22 @@ export default function LaancModal({ modal, handler }) {
return (