浏览代码

fix(track):1.轨迹清空时移除捕获对象 2.添加轨迹无限循环功能、常用属性值

tags/4.0.0
LizZ 1年前
父节点
当前提交
99a9dfd1aa
共有 2 个文件被更改,包括 27 次插入0 次删除
  1. 25
    0
      src/modules/history-track/Track.js
  2. 2
    0
      src/modules/history-track/TrackController.js

+ 25
- 0
src/modules/history-track/Track.js 查看文件

) )
this._state = State.INITIALIZED this._state = State.INITIALIZED
} }
get currentDistance() {
return distance(Parse.parsePositions(this._pathPositions))
}
get currentPosition() {
const [pos] = this._pathPositions.slice(-1)
return Parse.parsePosition(pos)
}
get allDistance() {
return distance(this._positions)
}


get trackId() { get trackId() {
return this._id return this._id
this._positionIndex + 1 === this._positions.length this._positionIndex + 1 === this._positions.length
) )
this._positionIndex++ this._positionIndex++
// 无限循环
if (
this._options.loop &&
this._positionIndex === this._positions.length
) {
this._restart()
}
} }
} }
} }
this._setCameraView(viewer, viewOption) this._setCameraView(viewer, viewOption)
} }


/**
* 重头开始播放动画
*/
_restart() {
this._startTime = Cesium.JulianDate.now()
this._resetTimeLine({})
}

/** /**
* Sets camera position * Sets camera position
* @param viewer * @param viewer

+ 2
- 0
src/modules/history-track/TrackController.js 查看文件

this._activedTrack && (this._activedTrack.viewed = false) this._activedTrack && (this._activedTrack.viewed = false)
this._activedTrack = undefined this._activedTrack = undefined
this._viewer.off(SceneEventType.POST_RENDER, this._onPostRender, this) this._viewer.off(SceneEventType.POST_RENDER, this._onPostRender, this)
this._viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)
this._viewer.delegate.trackedEntity = undefined
return this return this
} }
} }

正在加载...
取消
保存