liuyg
2021-06-22 0163b28ce3a2e0186b82e02fd8f98f8d9ee55340
widgets/FlyRoute/fly.js
@@ -30,6 +30,7 @@
            break;
         }
      }
        img_path
   };
   this.RouteCollection = {
      //线颜色
@@ -331,9 +332,15 @@
   };
   this.flyManager = {
        img_path: "widgets/FlyRoute/images/location4.png",
      //用于储存暂停时的位置
      Site_pause: {},
      play: function () {
            for (var i = 0; i < that.allSites.length; i++) {
                that.entities.removeById(that.allSites[i].ids);
            }
         //如果之前点的时停止重新开始飞行
         if (that.allSites.length > 1) {
            that.scene.screenSpaceCameraController.enableRotate = false;
@@ -376,6 +383,28 @@
      },
      stop: function () {
            //添加显示的站点
            var length = that.allSites.length;
            for (var j = 0; j < length; j++) {
                var flag = false;
                for (var i = 0; i < that.entities.values.length; i++) {
                    if (that.allSites[j].ids == that.entities.values[i].id) {
                        flag = true
                    }
                }
                if (flag == false) {
                    that.entities.add({
                        position: new Cesium.Cartesian3(that.allSites[j].position_x, that.allSites[j].position_y, that.allSites[j].position_z),
                        billboard: {
                            image: this.img_path,
                            width: 30,
                            height: 40,
                        },
                        //name : 10000+j,
                        id: that.allSites[j].ids
                    });
                }
            }
         if (that.setInterval_fly != null) {
            clearInterval(that.setInterval_fly);
            that.setInterval_fly = null;
@@ -389,7 +418,28 @@
         that.scene.screenSpaceCameraController.enableLook = true;
      },
      pause: function () {
            //添加显示的站点
            var length = that.allSites.length;
            for (var j = 0; j < length; j++) {
                var flag = false;
                for (var i = 0; i < that.entities.values.length; i++) {
                    if (that.allSites[j].ids == that.entities.values[i].id) {
                        flag = true
                    }
                }
                if (flag == false) {
                    that.entities.add({
                        position: new Cesium.Cartesian3(that.allSites[j].position_x, that.allSites[j].position_y, that.allSites[j].position_z),
                        billboard: {
                            image: this.img_path,
                            width: 30,
                            height: 40,
                        },
                        //name : 10000+j,
                        id: that.allSites[j].ids
                    });
                }
            }
         if (that.setInterval_fly != null) {
            clearInterval(that.setInterval_fly);
            that.setInterval_fly = null;