|
|
@ -715,75 +715,77 @@ export default function ControlApprovalsContainer({ mode }) { |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
<p> |
|
|
|
<p> |
|
|
|
{selected && drawObj.getMode() === 'simple_select' && ( |
|
|
|
{selected && |
|
|
|
<Input |
|
|
|
drawObj.getMode() === 'simple_select' && |
|
|
|
type='text' |
|
|
|
drawType === 'LINE' && ( |
|
|
|
bsSize='sm' |
|
|
|
<Input |
|
|
|
placeholder='반경을 입력해주세요' |
|
|
|
type='text' |
|
|
|
value={metersRadius} |
|
|
|
bsSize='sm' |
|
|
|
onKeyDown={e => { |
|
|
|
placeholder='반경을 입력해주세요' |
|
|
|
const input = e.target; |
|
|
|
value={metersRadius} |
|
|
|
const { value } = input; |
|
|
|
onKeyDown={e => { |
|
|
|
if (e.key === 'Backspace') { |
|
|
|
const input = e.target; |
|
|
|
if (input.length > 2) { |
|
|
|
const { value } = input; |
|
|
|
input.setSelectionRange( |
|
|
|
if (e.key === 'Backspace') { |
|
|
|
value.length - 2, |
|
|
|
if (input.length > 2) { |
|
|
|
value.length - 2 |
|
|
|
input.setSelectionRange( |
|
|
|
); |
|
|
|
value.length - 2, |
|
|
|
} else { |
|
|
|
value.length - 2 |
|
|
|
input.setSelectionRange( |
|
|
|
); |
|
|
|
value.length - 1, |
|
|
|
} else { |
|
|
|
value.length - 1 |
|
|
|
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, ''); |
|
|
|
onChange={e => { |
|
|
|
if (!val) return; |
|
|
|
const target = e.target; |
|
|
|
const sources = drawObj.getAll(); |
|
|
|
const { value, selectionStart } = target; |
|
|
|
|
|
|
|
// const numericValue = value.replace(/[^\d.]/g, '');
|
|
|
|
const option = { |
|
|
|
|
|
|
|
steps: 0, |
|
|
|
setMetersRadius( |
|
|
|
units: 'meters' |
|
|
|
value |
|
|
|
}; |
|
|
|
.replace(/^0+/, '') // 맨 앞의 0 제거
|
|
|
|
const rad = turf.circle( |
|
|
|
.replace(/[^\d.]/g, '') // 숫자가 아닌 문자 제거
|
|
|
|
sources.features[0].geometry.coordinates[0], |
|
|
|
.replace(/\B(?=(\d{3})+(?!\d))/g, ',') + 'm' |
|
|
|
parseInt(val), |
|
|
|
|
|
|
|
option |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
}} |
|
|
|
drawObj.set({ |
|
|
|
onBlur={() => { |
|
|
|
type: 'FeatureCollection', |
|
|
|
if (metersRadius === 'm') { |
|
|
|
features: [ |
|
|
|
setMetersRadius('0m'); |
|
|
|
{ ...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'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
</p> |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|