打算做一个模拟台风网台风显示的效果,但是一直无法做到线段随动画展示

Cesium源码 · miniMapUser · 于 2年前 发布 · 2399 次阅读

最开始的时候路径和时间点的展示,直接绘出,然后台风标志使用的是availability

viewer.entities.add({
                        id: params.tfbh,
                        availability: new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({ start: start, stop: stop })]),
                        position: positionProperty,
                        orientation: new Cesium.VelocityOrientationProperty(positionProperty),
                        // Attach the 3D model instead of the green point.
                        // model: { uri: airplaneUri },
                        point: { pixelSize: 15, color: Cesium.Color.RED }
                        // Automatically compute the orientation from the position.
                        // orientation: new Cesium.VelocityOrientationProperty(positionProperty),
                    })

这样效果是台风在轨迹运动 但是应该是台风到哪轨迹就画到哪 另外不同时间的位置点也应该在台风运动到相关位置时显示 于是我又把直接绘出的路径和点删除了 监听了一下画布重新渲染

that.viewer.scene.postUpdate.addEventListener((scene) => {
                        that.viewer.entities.values.forEach(item => {
                            if (thisTyphoon !== '') {
                                if (item.id === params.tfbh) {
                                    thisTyphoon = item
                                }
                            }
                        })
                        if (thisTyphoon) {
                            // 获取台风当前位置
                        }
                    })

根据id判断当前台风是否已经显示 但是availability的位置或者说索引却没办法获取 我本来的思路是监听台风图标的运动实时画线 但是卡到了当前这一步。 要是大家有好的思路可以解惑万分感谢

共收到 0 条回复
没有找到数据。
添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics