|
|
|
|
@ -757,11 +757,25 @@ const setItemsId = (e) => {
|
|
|
|
|
const locationData = ref({})
|
|
|
|
|
const currentPosition = ref({})
|
|
|
|
|
|
|
|
|
|
const getDistanceInMeters = (lon1, lat1, lon2, lat2) => {
|
|
|
|
|
const R = 6371000; // 地球半径(米)
|
|
|
|
|
const toRad = deg => deg * Math.PI / 180;
|
|
|
|
|
|
|
|
|
|
const dLat = toRad(lat2 - lat1);
|
|
|
|
|
const dLon = toRad(lon2 - lon1);
|
|
|
|
|
|
|
|
|
|
const a =
|
|
|
|
|
Math.sin(dLat / 2) ** 2 +
|
|
|
|
|
Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) * Math.sin(dLon / 2) ** 2;
|
|
|
|
|
|
|
|
|
|
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
|
|
|
return R * c;
|
|
|
|
|
}
|
|
|
|
|
const processData = (data) => {
|
|
|
|
|
// console.log('data',data.ty)
|
|
|
|
|
console.log('FodName', data.FodName)
|
|
|
|
|
// console.log('FodName', data.FodName)
|
|
|
|
|
if (data.FodName === '雷达信息') {
|
|
|
|
|
console.log('雷达信息', data.radar_work_state)
|
|
|
|
|
// console.log('雷达信息', data.radar_work_state)
|
|
|
|
|
radarWorkState.value = data.radar_work_state
|
|
|
|
|
}
|
|
|
|
|
if (data.FodName === '图像数据') {
|
|
|
|
|
@ -776,13 +790,11 @@ const processData = (data) => {
|
|
|
|
|
lon: data.Longitude,
|
|
|
|
|
lat: data.Latitude,
|
|
|
|
|
}
|
|
|
|
|
console.log(area)
|
|
|
|
|
console.log(data)
|
|
|
|
|
// console.log(data.Longitude > area.LonMin, data.Longitude < area.LonMax, data.Latitude > area.LatMin, data.Latitude < area.LatMax)
|
|
|
|
|
if (data.Longitude > area.LonMin && data.Longitude < area.LonMax && data.Latitude > area.LatMin && data.Latitude < area.LatMax) {
|
|
|
|
|
let location = {
|
|
|
|
|
x: data.Longitude,
|
|
|
|
|
y: data.Latitude,
|
|
|
|
|
x: getDistanceInMeters(data.Longitude, area.LonMin),
|
|
|
|
|
y: getDistanceInMeters(data.Latitude, area.LatMin),
|
|
|
|
|
rotate: data.HeadingAngle
|
|
|
|
|
// rotate: 0
|
|
|
|
|
}
|
|
|
|
|
|