|
|
|
@ -87,8 +87,8 @@ const LEFT = defineComponent({
|
|
|
|
<Ruler
|
|
|
|
<Ruler
|
|
|
|
ref={rulerRef}
|
|
|
|
ref={rulerRef}
|
|
|
|
index={dotIndex.value}
|
|
|
|
index={dotIndex.value}
|
|
|
|
width={500}
|
|
|
|
width={areaData.value.width}
|
|
|
|
height={1000}
|
|
|
|
height={areaData.value.height}
|
|
|
|
boxPos={boxPos.value}
|
|
|
|
boxPos={boxPos.value}
|
|
|
|
dots={dots.value}
|
|
|
|
dots={dots.value}
|
|
|
|
dotIndex={0}
|
|
|
|
dotIndex={0}
|
|
|
|
@ -1092,13 +1092,16 @@ function getBoundingBoxAndSize(points) {
|
|
|
|
return R * c;
|
|
|
|
return R * c;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const width = haversineDistance(minLat, minLon, minLat, maxLon);
|
|
|
|
const width = Math.round(haversineDistance(minLat, minLon, minLat, maxLon))
|
|
|
|
const height = haversineDistance(minLat, minLon, maxLat, minLon);
|
|
|
|
const height = Math.round(haversineDistance(minLat, minLon, maxLat, minLon))
|
|
|
|
|
|
|
|
|
|
|
|
return {width, height};
|
|
|
|
return {width, height};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const areaData = ref({
|
|
|
|
|
|
|
|
width: 500,
|
|
|
|
|
|
|
|
height: 1000
|
|
|
|
|
|
|
|
})
|
|
|
|
const saveAreaPoint = () => {
|
|
|
|
const saveAreaPoint = () => {
|
|
|
|
let arr = []
|
|
|
|
let arr = []
|
|
|
|
areaPoints.value.forEach((v, k) => {
|
|
|
|
areaPoints.value.forEach((v, k) => {
|
|
|
|
@ -1106,7 +1109,7 @@ const saveAreaPoint = () => {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
Promise.all(arr).then(() => {
|
|
|
|
Promise.all(arr).then(() => {
|
|
|
|
ElMessage.success('保存成功')
|
|
|
|
ElMessage.success('保存成功')
|
|
|
|
console.log(getBoundingBoxAndSize(areaPoints.value))
|
|
|
|
areaData.value = getBoundingBoxAndSize(areaPoints.value)
|
|
|
|
}).catch((err) => {
|
|
|
|
}).catch((err) => {
|
|
|
|
ElMessage.error(err)
|
|
|
|
ElMessage.error(err)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|