Cesium使用-飞行漫游
一、监听isPause变量判断是否需要暂停
代码如下(示例):
watch: {
//获取viewer对象
viewerId (id) {
if (id) {
viewer = getViewer(id)
}
},
// 监听isPause变量实现是否需要暂停
isPause (newVal) {
if (newVal) {
fly.pause()
this.flying = false
if (!this.isShowvideoTag) {
// this.$refs.video.create()
}
} else {
fly.resume()
this.flying = true
this.$parent.clearVideo(5)
// this.$refs.video.destroy()
}
}
}
二、使用步骤
1.开始漫游
代码如下(示例):
plan3是一个数组,存储了点位信息,包括经纬度倾斜角度等等,当存在video标签是则会进行暂停并播放视频
// 开始漫游
onStartFly () {
const camera = viewer.camera
if (!viewer) {
return
}
if (routePath) {
viewer.entities.remove(routePath)