huweili-cesium 1.2.69 → 1.2.70

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/movePath.js CHANGED
@@ -48,12 +48,17 @@ export function movePathConfig() {
48
48
  const positions = trailData.positions
49
49
  const renderPositions = trailData.renderPositions || (trailData.renderPositions = positions.map(point => point.position).filter(Boolean))
50
50
 
51
- // 轨迹必须和无人机同频更新:收到一次位置就立刻追加一次,不做距离/时间节流。
51
+ // 轨迹必须和无人机完全同步:每次直接复用同一个点,避免出现一帧延迟的间隙。
52
52
  const clonedPosition = Cesium.Cartesian3.clone(newPosition)
53
53
  positions.push({ position: clonedPosition, timestamp: Cesium.JulianDate.clone(currentTime) })
54
54
  renderPositions.push(clonedPosition)
55
55
  trailData.lastUpdateTime = currentTime
56
56
 
57
+ // 立刻通知 Cesium 重新取轨迹数组,避免 CallbackProperty 在下一帧才刷新。
58
+ if (trailData.entity?.polyline) {
59
+ trailData.entity.polyline.positions = renderPositions
60
+ }
61
+
57
62
  // 清理旧轨迹点,只保留最近指定时间的轨迹
58
63
  const trailTime = mapStore.getTrailTime(mapId)
59
64
  if (trailTime === -1 || positions.length <= 1) return trailData
package/js/movePoint.js CHANGED
@@ -266,6 +266,9 @@ export function movePointConfig(baseUrl) {
266
266
 
267
267
  modelEntity.isFlying = false
268
268
  modelEntity.currentPosition = Cesium.Cartesian3.clone(targetPosition, modelEntity.currentPosition || new Cesium.Cartesian3())
269
+ modelEntity.positionProperty = {
270
+ getValue: () => modelEntity.currentPosition
271
+ }
269
272
  modelEntity.info = modelEntity.info || {}
270
273
  modelEntity.info.pointId = pointId
271
274
  modelEntity.info.lng = lng
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "huweili-cesium",
3
- "version": "1.2.69",
3
+ "version": "1.2.70",
4
4
  "description": "基于 Cesium 的地图工具库(无人机态势、轨迹、围栏、工具栏等)",
5
5
  "type": "module",
6
6
  "main": "./index.js",