diff --git a/src/views/index.vue b/src/views/index.vue index 9bb76d0..71e55bb 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -38,6 +38,7 @@ const scaleRatio = ref(window.innerWidth / 1080) const onSubmit = (e) => { console.log(e) } +const boxPos = ref({x: 100, y: 100, rotate: 30}) const TOP = defineComponent({ name: 'TOP', @@ -81,7 +82,6 @@ const TOP = defineComponent({ const LEFT = defineComponent({ name: 'LEFT', setup() { - const boxPos = ref({x: 100, y: 100, rotate: 30}) return () => (
{ // rotate: 0 } console.log('location', location) - locationData.value = location + boxPos.value = location } } @@ -1095,7 +1095,7 @@ function getBoundingBoxAndSize(points) { const width = Math.round(haversineDistance(minLat, minLon, minLat, maxLon)) const height = Math.round(haversineDistance(minLat, minLon, maxLat, minLon)) - return {width, height}; + return {width, height, minLat, minLon, maxLat, minLon}; } const areaData = ref({ @@ -1109,7 +1109,14 @@ const saveAreaPoint = () => { }) Promise.all(arr).then(() => { ElMessage.success('保存成功') - areaData.value = getBoundingBoxAndSize(areaPoints.value) + let data = getBoundingBoxAndSize(areaPoints.value) + areaData.value = data + area.value = { + "LatMin": data.minLat, + "LatMax": data.maxLat, + "LonMin": data.minLon, + "LonMax": data.minLon + } }).catch((err) => { ElMessage.error(err) })