Browse Source

비행구역 좌표정보창 마우스 드래그 포인터 추가

pull/2/head
junh_eee(이준희) 10 months ago
parent
commit
37b38cf8ac
  1. 9
      src/components/laanc/map/LaancAreaMap.js

9
src/components/laanc/map/LaancAreaMap.js

@ -361,6 +361,11 @@ export default function LaancAreaMap({
}; };
const onMouseUp = e => { const onMouseUp = e => {
e.preventDefault();
setIsDrag(false);
};
const onMouseLeave = () => {
setIsDrag(false); setIsDrag(false);
}; };
@ -371,10 +376,12 @@ export default function LaancAreaMap({
<LaancMapSearch mapObject={mapObject} /> <LaancMapSearch mapObject={mapObject} />
<div <div
className='d-flex coords-wrap' className='d-flex coords-wrap'
style={{ cursor: isDrag ? 'pointer' : 'default' }}
ref={scrollRef} ref={scrollRef}
onMouseDown={onMouseDown} onMouseDown={onMouseDown}
onMouseMove={isDrag ? throttle(onMouseMove, 50) : null} onMouseMove={isDrag ? throttle(onMouseMove, 50) : null}
onMouseUp={onMouseUp} onMouseUp={onMouseUp}
onMouseLeave={onMouseLeave}
> >
{viewCoordObj?.map((obj, i) => { {viewCoordObj?.map((obj, i) => {
let coord = let coord =
@ -392,6 +399,7 @@ export default function LaancAreaMap({
className='coords-box' className='coords-box'
key={i} key={i}
onClick={() => { onClick={() => {
if (!isDrag) {
const allObj = drawObj const allObj = drawObj
.getAll() .getAll()
.features.filter( .features.filter(
@ -401,6 +409,7 @@ export default function LaancAreaMap({
drawObj.changeMode('direct_select', { drawObj.changeMode('direct_select', {
featureId: allObj[i].id featureId: allObj[i].id
}); });
}
}} }}
> >
<div> <div>

Loading…
Cancel
Save