Browse Source

laanc 비행구역 선택좌표 표출 에러 수정

pull/2/head
junh_eee(이준희) 11 months ago
parent
commit
e5d0b5544a
  1. 71
      src/views/laanc/LaancAreaMap.js

71
src/views/laanc/LaancAreaMap.js

@ -326,31 +326,78 @@ export default function LaancAreaMap({
obj.properties.id === 'LINE' obj.properties.id === 'LINE'
? obj.geometry.coordinates ? obj.geometry.coordinates
: obj.geometry.coordinates[0]; : obj.geometry.coordinates[0];
// if (obj.properties.id === 'POLYGON') coord.splice(-1);
// console.log(coord, '>>>>>>>>>.');
return ( return (
<div> <div>
<h6 className='ti'>비행구역 {i + 1}</h6> <h6 className='ti'>비행구역 {i + 1}</h6>
<div className='coords-box-scroll'> <div className='coords-box-scroll'>
{coord?.map((co, idx) => { {coord?.map((co, idx) => {
if (idx + 1 < coord.length) { if (idx % 2 === 0) {
const fCoord = FormattingCoord(co); const fCoord = FormattingCoord(co);
const current = fCoord.join(', '); const current = fCoord.join(', ');
const next = FormattingCoord( if (idx !== coord.length - 1) {
coord[idx + 1].join(', ') const next = FormattingCoord(coord[idx + 1]).join(
', '
); );
// console.log(coord[idx + 1], '---next');
return ( return (
<div className='coords-box-list'> <div className='coords-box-list' key={idx}>
<span key={idx}> <span>
<span>{current}</span> <span>{current}</span>
<span className='etc'>/</span> <span className='etc'>/</span>
<span>{next}</span> <span>{next}</span>
</span> </span>
</div> </div>
); );
} else {
return (
<div className='coords-box-list' key={idx}>
<span>
<span>{current}</span>
</span>
</div>
);
}
} else {
return null;
} }
// if (idx % 1 === 0) {
// const fCoord = FormattingCoord(co);
// const prev = coord[idx - 1].join(', ');
// const next = fCoord.join(', ');
// return (
// <div className='coords-box-list'>
// <span key={idx}>
// <span>{prev}</span>
// <span className='etc'>/</span>
// <span>{next}</span>
// </span>
// </div>
// );
// } else {
// return null;
// }
// if (idx + 1 < coord.length) {
// const fCoord = FormattingCoord(co);
// const current = fCoord.join(', ');
// const next = FormattingCoord(
// coord[idx + 1].join(', ')
// );
// return (
// <div className='coords-box-list'>
// <span key={idx}>
// <span>{current}</span>
// <span className='etc'>/</span>
// <span>{next}</span>
// </span>
// </div>
// );
// }
// return null;
})} })}
</div> </div>
</div> </div>
@ -358,6 +405,16 @@ export default function LaancAreaMap({
})} })}
</div> </div>
) : null} ) : null}
{/* coords-box
div
ti
coords-box-scroll
coords-box-list
coords-box-list
span
span위도, 경도
span /
span 위도, 경도 */}
{/* {mapObject ? ( {/* {mapObject ? (
<div className='coords-box'> <div className='coords-box'>
{drawObj.getAll().features.length > 1 {drawObj.getAll().features.length > 1

Loading…
Cancel
Save