liuyg
2021-06-15 d16c4f06f2699b18bfa3b449595868feec9f808b
widgets/FlyRoute/fly.js
@@ -11,6 +11,7 @@
      return false;
   }
}
function Fly_NZC(viewer){
   this.viewer=viewer;
   this.scene=viewer.scene;
@@ -47,9 +48,16 @@
          that.allSites=[];
          for (var i = 0; i < Route.length; i++) {
             let cartesian3 = Cesium.Cartesian3.fromDegrees(Route[i].lgtd, Route[i].lttd, Route[i].height);
             let site = {"ids":Route[i].id,"position_x":cartesian3.x,"position_y":cartesian3.y,"position_z":cartesian3.z,
                      "pitch":Cesium.Math.toRadians(Route[i].pitch),"heading":Cesium.Math.toRadians(Route[i].heading),
                      "roll":Cesium.Math.toRadians(Route[i].roll),"time":Route[i].time};
            let site = {
               "ids": Route[i].id,
               "position_x": cartesian3.x,
               "position_y": cartesian3.y,
               "position_z": cartesian3.z,
               "pitch": Cesium.Math.toRadians(Route[i].pitch),
               "heading": Cesium.Math.toRadians(Route[i].heading),
               "roll": Cesium.Math.toRadians(Route[i].roll),
               "time": Route[i].time
            };
             that.allSites[i]=site;
          }
            this.controlEntities();
@@ -66,9 +74,11 @@
       setVisible:function(mod,bool){
           if(mod===0){
              this.point_show=bool;
          }if(mod===1){
         }
         if (mod === 1) {
              this.line_show=bool;
          }if(mod===2){
         }
         if (mod === 2) {
              this.point_show=bool;
              this.line_show=bool;
          }
@@ -118,7 +128,6 @@
                 //添加到站点数组
                 that.allSites.push(Site);
                 this.controlEntities();
                 console.log(that.allSites);
                 return  true;
             }catch(e){
                 return  false;
@@ -302,8 +311,7 @@
         if(Math.abs(tem)>180){
            if(tem>=0){
               tem = 360 - tem;
            }
            else{
            } else {
               tem = 360 + tem;
            }
            h = Cesium.Math.toRadians(tem);
@@ -333,6 +341,8 @@
                   that.scene.screenSpaceCameraController.enableZoom = false;
                   that.scene.screenSpaceCameraController.enableTilt = false;
                   that.scene.screenSpaceCameraController.enableLook = false;
              if(that.play_bool){
                   //设置初始点
                    that.scene.camera.setView({
@@ -343,7 +353,11 @@
                           roll : that.allSites[that.l].roll
                       }
                   });
               if (that.setInterval_fly) {
                  clearInterval(that.setInterval_fly);
               }
                   that.Interval();
              }else{
                //如果之前是暂停,继续飞行
                that.scene.camera.setView({
@@ -355,6 +369,7 @@
                          roll : this.Site_pause.roll
                      }
                  });
                  that.Interval();
              }
           }