diff --git a/src/views/index.vue b/src/views/index.vue index af73d55..6e05917 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -1173,37 +1173,16 @@ const savePoint = () => { const setDot = (e) => { let dots = e.DarDatas.map((v, k) => { if (v.Lon == 0 && v.Lat == 0) return null - let xAndy = getXYDistanceFromMin({lon: v.Lon, lat: v.Lat}, {lon: area.LonMin, lat: area.LatMin}) - let location = {} - if (areaType.value === 1) { - location = { - x: xAndy.xDistance, - y: xAndy.yDistance, - } - } else if (areaType.value === 2) { - location = { - x: areaData.value.width - xAndy.yDistance, - y: xAndy.xDistance, - } - } else if (areaType.value === 3) { - location = { - x: areaData.value.width - xAndy.xDistance, - y: areaData.value.height - xAndy.yDistance, - } - } else if (areaType.value === 4) { - location = { - x: xAndy.yDistance, - y: areaData.value.height - xAndy.xDistance, - } - } else { - location = { - x: xAndy.xDistance, - y: xAndy.yDistance, - } - } + const rectInfo = calcRectangleFromPoints(areaPoints.value); + const point = { + lon: v.Lon, + lat: v.Lat, + rotate: 0 + }; + const local = getLocalPositionRelativeToP4(point, areaPoints.value, rectInfo); - return location + return local }).filter(v => v) tableData1.value = [...tableData1.value, ...e.DarDatas.filter(v => v.Lon !== 0 && v.Lat !== 0).map((v, k) => { return {...v, index: k}