huweili-cesium 1.2.83 → 1.2.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/labelDiv.js +4 -4
- package/package.json +1 -1
package/js/labelDiv.js
CHANGED
|
@@ -150,9 +150,9 @@ export function labelDiv() {
|
|
|
150
150
|
? `${groundLinkLng},${groundLinkLat}`
|
|
151
151
|
: (info?.flyingHandPosition ?? '--');
|
|
152
152
|
|
|
153
|
-
// 处理距离(保留1
|
|
154
|
-
const parseDistance = parseFloat(info?.distance)
|
|
155
|
-
const distance =
|
|
153
|
+
// 处理距离(保留1位小数,单位 m 在模板中单独展示)
|
|
154
|
+
const parseDistance = parseFloat(String(info?.distance ?? '').replace(/[^\d.-]/g, ''))
|
|
155
|
+
const distance = Number.isFinite(parseDistance) ? parseDistance.toFixed(1) : '--'
|
|
156
156
|
const nextInfoText = `${lng}|${lat}|${alt}|${speed}|${flyingHandName}|${flyingHandPhone}|${frequencyBand}|${distance}|${receiveTime}`;
|
|
157
157
|
|
|
158
158
|
if (nextInfoText !== lastInfoText && infoFieldEls) {
|
|
@@ -215,7 +215,7 @@ export function labelDiv() {
|
|
|
215
215
|
<div class="drone-detail-grid">
|
|
216
216
|
<div><span class="pilot-title">高度:</span><span class="alt">-</span>m</div>
|
|
217
217
|
<div><span class="pilot-title">速度:</span><span class="speed">-</span>m/s</div>
|
|
218
|
-
<div><span class="pilot-title">距离:</span><span class="distance">
|
|
218
|
+
<div><span class="pilot-title">距离:</span><span class="distance">-</span>m</div>
|
|
219
219
|
${!isUnknown ? '<div><span class="pilot-title">频段:</span><span class="band">2.4GHz、5.8GHz</span></div>' : ''}
|
|
220
220
|
</div>
|
|
221
221
|
${!isUnknown ? `
|