生成检测点
This commit is contained in:
parent
132a9f0f70
commit
ae961eaf69
@ -4,9 +4,9 @@ NODE_ENV=development
|
||||
VITE_DEV=true
|
||||
|
||||
# 请求路径
|
||||
# VITE_BASE_URL='http://10.10.7.132:48080'
|
||||
VITE_BASE_URL='http://10.10.7.132:48080'
|
||||
# VITE_BASE_URL='http://10.10.100.15:48080'
|
||||
VITE_BASE_URL='http://10.10.5.5:48080'
|
||||
# VITE_BASE_URL='http://10.10.5.5:48080'
|
||||
|
||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
||||
VITE_UPLOAD_TYPE=server
|
||||
|
@ -255,3 +255,11 @@ export const getHouseLocationTypeList = async (params) => {
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
//获取检测点距离
|
||||
export const getCheckDistance = async (params) => {
|
||||
return await request.get({
|
||||
url: `/system/position-map-item/getCheckDistance`,
|
||||
params
|
||||
})
|
||||
}
|
||||
|
@ -2171,15 +2171,16 @@ const generateDetectionPoint = async () => {
|
||||
state.contextMenu.currentItem
|
||||
|
||||
const newId = await MapApi.getNodeId()
|
||||
const distance = 2 / Number(imgBgObj.resolution) //距离米
|
||||
const distance = await MapApi.getCheckDistance()
|
||||
const distanceValue = Number(distance) / Number(imgBgObj.resolution) //距离米
|
||||
|
||||
// 将弧度转换为角度(用于理解,实际计算仍使用弧度)
|
||||
const angle = locationYaw * (180 / Math.PI)
|
||||
|
||||
// 根据角度和距离计算新的坐标
|
||||
// 正东方向为0度,正北方向为90度,正西方向为180度,正南方向为-90度
|
||||
const newX = Number((Number(locationX) + distance * Math.cos(locationYaw)).toFixed(2))
|
||||
const newY = Number((Number(locationY) - distance * Math.sin(locationYaw)).toFixed(2))
|
||||
const newX = Number((Number(locationX) + distanceValue * Math.cos(locationYaw)).toFixed(2))
|
||||
const newY = Number((Number(locationY) - distanceValue * Math.sin(locationYaw)).toFixed(2))
|
||||
|
||||
//先校验这个点是否存在,比较一位小数
|
||||
const isDuplicate = state.allMapPointInfo.some(
|
||||
|
Loading…
Reference in New Issue
Block a user