|
|
|
@ -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; |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|