diff --git a/src/containers/flight/ControlApprovalsContainer.js b/src/containers/flight/ControlApprovalsContainer.js index cddd4af7..3d4fc2d8 100644 --- a/src/containers/flight/ControlApprovalsContainer.js +++ b/src/containers/flight/ControlApprovalsContainer.js @@ -715,75 +715,77 @@ export default function ControlApprovalsContainer({ mode }) {

- {selected && drawObj.getMode() === 'simple_select' && ( - { - const input = e.target; - const { value } = input; - if (e.key === 'Backspace') { - if (input.length > 2) { - input.setSelectionRange( - value.length - 2, - value.length - 2 - ); - } else { - input.setSelectionRange( - value.length - 1, - value.length - 1 + {selected && + drawObj.getMode() === 'simple_select' && + drawType === 'LINE' && ( + { + const input = e.target; + const { value } = input; + if (e.key === 'Backspace') { + if (input.length > 2) { + input.setSelectionRange( + value.length - 2, + value.length - 2 + ); + } else { + input.setSelectionRange( + value.length - 1, + value.length - 1 + ); + } + } else if (e.key === 'Enter') { + let val = value.replace(/[^\d.]/g, ''); + if (!val) return; + const sources = drawObj.getAll(); + + const option = { + steps: 0, + units: 'meters' + }; + const rad = turf.circle( + sources.features[0].geometry.coordinates[0], + parseInt(val), + option ); + + drawObj.set({ + type: 'FeatureCollection', + features: [ + { ...sources.features[0] }, + { + type: 'Feature', + properties: {}, + id: 'pal_Polygon_string', + geometry: { ...rad.geometry } + } + ] + }); } - } else if (e.key === 'Enter') { - let val = value.replace(/[^\d.]/g, ''); - if (!val) return; - const sources = drawObj.getAll(); - - const option = { - steps: 0, - units: 'meters' - }; - const rad = turf.circle( - sources.features[0].geometry.coordinates[0], - parseInt(val), - option + }} + onChange={e => { + const target = e.target; + const { value, selectionStart } = target; + // const numericValue = value.replace(/[^\d.]/g, ''); + + setMetersRadius( + value + .replace(/^0+/, '') // 맨 앞의 0 제거 + .replace(/[^\d.]/g, '') // 숫자가 아닌 문자 제거 + .replace(/\B(?=(\d{3})+(?!\d))/g, ',') + 'm' ); - - drawObj.set({ - type: 'FeatureCollection', - features: [ - { ...sources.features[0] }, - { - type: 'Feature', - properties: {}, - id: 'pal_Polygon_string', - geometry: { ...rad.geometry } - } - ] - }); - } - }} - onChange={e => { - const target = e.target; - const { value, selectionStart } = target; - // const numericValue = value.replace(/[^\d.]/g, ''); - - setMetersRadius( - value - .replace(/^0+/, '') // 맨 앞의 0 제거 - .replace(/[^\d.]/g, '') // 숫자가 아닌 문자 제거 - .replace(/\B(?=(\d{3})+(?!\d))/g, ',') + 'm' - ); - }} - onBlur={() => { - if (metersRadius === 'm') { - setMetersRadius('0m'); - } - }} - /> - )} + }} + onBlur={() => { + if (metersRadius === 'm') { + setMetersRadius('0m'); + } + }} + /> + )}

diff --git a/src/containers/flight/OperationApprovalsContainer.js b/src/containers/flight/OperationApprovalsContainer.js index f50c384b..6671e0e3 100644 --- a/src/containers/flight/OperationApprovalsContainer.js +++ b/src/containers/flight/OperationApprovalsContainer.js @@ -869,7 +869,8 @@ export default function OperationApprovalsContainer({ mode }) {

{selectedPlanSno && - drawObj.getMode() === 'simple_select' && ( + drawObj.getMode() === 'simple_select' && + drawType === 'LINE' && (