我的github
posts - 3243,  comments - 42,  views - 158万

(1)cesium加载轨迹数据json文件

(2)飞机沿着路线飞行,视角也跟着移动

参考1:https://blog.csdn.net/A873054267/article/details/86231494(cesium轨迹回放,按路径飞行)

飞机在动。。但是视角没有跟着动。(第一视角)

复制代码
value: function _createEntity() {
      var _this2 = this;

      var entityAttr = {
        name: this.name,
        position: new Cesium.CallbackProperty(function (time) {
          return _this2.position;
        }, false),
        orientation: this.velocityOrientation,
        point: {
          //必须有对象,否则viewer.trackedEntity无法跟随(无model时使用)
          show: !(this.options.model && this.options.model.show),
          color: Cesium.Color.fromCssColorString("#ffffff").withAlpha(0.01),
          pixelSize: 1
          // show: false
        } };

      if (this.options.label && this.options.label.show) {
        this.options.label.text = this.options.label.text || this.name;
        entityAttr.label = drawAttr.label.style2Entity(this.options.label, null, this);
      }
      if (this.options.billboard && this.options.billboard.show) {
        entityAttr.billboard = drawAttr.billboard.style2Entity(this.options.billboard);
      }
      if (this.options.point && this.options.point.show) {
        entityAttr.point = drawAttr.point.style2Entity(this.options.point);
      }
      if (this.options.model && this.options.model.show) {
        entityAttr.model = drawAttr.model.style2Entity(this.options.model);
      }
      if (this.options.path && this.options.path.show) {
        var pathAttr = drawAttr.polyline.style2Entity(this.options.path);
        if (!pathAttr.isAll) {
          pathAttr.leadTime = 0; //只显示飞过的路线
          pathAttr.trailTime = this.alltimes * 10;
        }
        entityAttr.path = pathAttr;
        entityAttr.position = this.property; //path时需要为直接property
      }
      if (this.options.circle && this.options.circle.show) {
        entityAttr.ellipse = drawAttr.circle.style2Entity(this.options.circle);
      }
      this.entity = this.viewer.entities.add(new Cesium.Entity(entityAttr));

      this.entity.eventTarget = this;
      if (this.popup) this.entity.popup = this.popup;
      if (this.tooltip) this.entity.tooltip = this.tooltip;
    }
复制代码

 

posted on   XiaoNiuFeiTian  阅读(2170)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
历史上的今天:
2019-10-28 GDAL编译
2018-10-28 部署图像深度学习Web网站
2016-10-28 第二届普适计算和信号处理及应用国际会议论文2016年 The 2nd Conference on Pervasive Computing, Signal Processing and Applications(PCSPA, 2016)
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示