diff --git a/src/containers/flight/OperationApprovalsContainer.js b/src/containers/flight/OperationApprovalsContainer.js
index 98212953..3a5c9801 100644
--- a/src/containers/flight/OperationApprovalsContainer.js
+++ b/src/containers/flight/OperationApprovalsContainer.js
@@ -490,7 +490,7 @@ export default function OperationApprovalsContainer({ mode }) {
const handlerMapTypeChange = val => {
// dispatch(clientChangeDrawType(''));
- drawObj.changeMode('simple_select');
+ handlerDistanceClose();
setMapType(val);
};
@@ -570,12 +570,14 @@ export default function OperationApprovalsContainer({ mode }) {
let distanceMarker = new mapboxgl.Popup({
closeButton: false,
closeOnClick: false,
- anchor: 'bottom',
+ offset: {
+ bottom: [0, -10]
+ },
focusAfterOpen: false
})
.setLngLat([i.coord[0][0].toFixed(6), i.coord[0][1].toFixed(6)])
.setHTML(
- `
${i.text}
`
+ `${i.text}
`
)
.addTo(mapInstance);
@@ -587,7 +589,9 @@ export default function OperationApprovalsContainer({ mode }) {
setIsDistanceStartPoint(true);
isSetResetDisabled(false);
} else {
- setIsDistanceStartPoint(false);
+ if (draw.getMode() === 'draw_line_string') {
+ setIsDistanceStartPoint(false);
+ }
}
};
diff --git a/src/utility/MapUtils.js b/src/utility/MapUtils.js
index c222cebe..6566052a 100644
--- a/src/utility/MapUtils.js
+++ b/src/utility/MapUtils.js
@@ -700,6 +700,10 @@ export const handlerOnClickDrawLineString = (
totalDistanceRef.current.innerText = `총 거리 : ${distance.toLocaleString()}m`;
}
}
+ if (drawObj.getMode() === 'direct_select') {
+ const markerList = getDintancePointPopupList(drawObj);
+ callback(mapInstance, markerList, drawObj);
+ }
if (drawObj.getMode() === 'draw_line_string') {
if (drawObj.getAll().features[0].geometry.coordinates.length === 1) {
mouseCursorRef.current.style.display = 'block';
@@ -709,19 +713,22 @@ export const handlerOnClickDrawLineString = (
}
}
});
+ mapInstance.on('mouseout', e => {
+ mouseCursorRef.current.style.display = 'none';
+ });
- mapInstance.on('draw.modechange', obj => {
- if (obj.mode === 'simple_select') {
- totalDistanceRef.current.style.display = 'block';
- const distance = getDrawDistance(drawObj);
- totalDistanceRef.current.innerText = `총 거리 : ${distance.toLocaleString()}m`;
- mouseCursorRef.current.style.display = 'none';
- mouseCursorRef.current.style.innerText = '';
- const markerList = getDintancePointPopupList(drawObj);
- startPoint = null;
- callback(mapInstance, markerList, drawObj);
- } else if (obj.mode === 'direct_select') {
- }
+ // mapInstance.on('draw.modechange', obj => {
+ // if (obj.mode === 'simple_select') {
+ // }
+ // });
+
+ mapInstance.on('draw.create', () => {
+ totalDistanceRef.current.style.display = 'block';
+ const distance = getDrawDistance(drawObj);
+ totalDistanceRef.current.innerText = `총 거리 : ${distance.toLocaleString()}m`;
+ mouseCursorRef.current.style.display = 'none';
+ mouseCursorRef.current.style.innerText = '';
+ startPoint = null;
});
};