Browse Source

真方位磁方位修改

lbj
sd 2 months ago
parent
commit
5212736bf9
  1. 109
      ruoyi-ui/src/views/cesiumMap/index.vue

109
ruoyi-ui/src/views/cesiumMap/index.vue

@ -965,15 +965,28 @@ export default {
const bearing = bearingType === 'magnetic'
? this.calculateMagneticBearing(currentSegmentPositions)
: this.calculateTrueBearing(currentSegmentPositions);
//
this.hoverTooltip = {
visible: true,
content: `累计长度:${cumulativeLength.toFixed(2)}\n${bearingType === 'magnetic' ? '磁方位' : '真方位'}${bearing.toFixed(2)}°`,
position: {
x: movement.endPosition.x + 10,
y: movement.endPosition.y - 10
}
};
//
if (this.toolMode === 'ranging') {
// 使
this.hoverTooltip = {
visible: true,
content: `${(cumulativeLength / 1000).toFixed(1)}km ,${bearingType === 'magnetic' ? '磁' : '真'}${bearing.toFixed(1)}°`,
position: {
x: movement.endPosition.x + 10,
y: movement.endPosition.y - 10
}
};
} else {
// 使
this.hoverTooltip = {
visible: true,
content: `累计长度:${cumulativeLength.toFixed(2)}\n${bearingType === 'magnetic' ? '磁方位' : '真方位'}${bearing.toFixed(2)}°`,
position: {
x: movement.endPosition.x + 10,
y: movement.endPosition.y - 10
}
};
}
} else {
//
this.hoverTooltip.visible = false;
@ -1252,15 +1265,28 @@ export default {
const length = this.calculateLineLength(tempPositions);
// bearingType
const bearing = this.calculateTrueBearing(tempPositions);
//
this.hoverTooltip = {
visible: true,
content: `长度:${length.toFixed(2)}\n真方位:${bearing.toFixed(2)}°`,
position: {
x: movement.endPosition.x + 10,
y: movement.endPosition.y - 10
}
};
//
if (this.toolMode === 'ranging') {
// 使
this.hoverTooltip = {
visible: true,
content: `${(length / 1000).toFixed(1)}km ,真:${bearing.toFixed(1)}°`,
position: {
x: movement.endPosition.x + 10,
y: movement.endPosition.y - 10
}
};
} else {
// 使
this.hoverTooltip = {
visible: true,
content: `长度:${length.toFixed(2)}\n真方位:${bearing.toFixed(2)}°`,
position: {
x: movement.endPosition.x + 10,
y: movement.endPosition.y - 10
}
};
}
} else {
//
this.hoverTooltip.visible = false;
@ -2692,20 +2718,45 @@ export default {
let declination;
if (lngDeg >= 73 && lngDeg <= 135 && latDeg >= 18 && latDeg <= 53) {
//
// 20200.1
// WMM2025
// 西西
// NOAA WMM-2025
const year = new Date().getFullYear();
const yearOffset = (year - 2020) * 0.1;
const yearOffset = (year - 2025) * 0.04;
if (lngDeg < 100) {
// 西
declination = 2.0 - yearOffset;
// 西西
if (latDeg > 40) {
// 西
declination = 3.0 - yearOffset;
} else if (latDeg > 32) {
// 西
declination = -2.0 - yearOffset;
} else {
// 西
declination = 1.0 - yearOffset;
}
} else if (lngDeg < 115) {
//
declination = 1.0 - yearOffset;
//
if (latDeg > 38) {
//
declination = -7.5 - yearOffset;
} else if (latDeg > 32) {
//
declination = -5.0 - yearOffset;
} else {
//
declination = -3.5 - yearOffset;
}
} else {
//
declination = 0.5 - yearOffset;
//
if (latDeg > 35) {
//
declination = -5.5 - yearOffset;
} else {
// 广
declination = -2.5 - yearOffset;
}
}
} else {
// 0
@ -2732,8 +2783,8 @@ export default {
//
const declination = this.calculateMagneticDeclination(startLat, startLng);
//
let magneticBearing = trueBearing + declination;
//
let magneticBearing = trueBearing - declination;
// 0-360
return (magneticBearing + 360) % 360;

Loading…
Cancel
Save