xyh 1 rok pred
rodič
commit
a11bf4257c
2 zmenil súbory, kde vykonal 16 pridanie a 16 odobranie
  1. 5 5
      src/views/simulation/index.vue
  2. 11 11
      src/views/situation/index.vue

+ 5 - 5
src/views/simulation/index.vue

@@ -549,7 +549,7 @@ export default {
       if (type == 'blue') {
         console.log(' radar!!!');
         const range = 100000;
-        this.viewer2D.entities.add({
+        this.$data._viewer2D.entities.add({
           id: this.id,
           position: position,
           ellipsoid: {
@@ -574,7 +574,7 @@ export default {
             pixelOffset: new this.Cesium.Cartesian2(0, 20) // 调整标签的像素偏移,向下偏移20像素
           }
         });
-        this.viewer3D.entities.add({
+        this.$data._viewer3D.entities.add({
           id: this.id,
           position: position,
           //         cylinder: {
@@ -614,7 +614,7 @@ export default {
         this.id++;
       }
       else {
-        this.viewer2D.entities.add({
+        this.$data._viewer2D.entities.add({
           id: this.id,
           position: position,
           point: {
@@ -633,7 +633,7 @@ export default {
             pixelOffset: new this.Cesium.Cartesian2(0, 20) // 调整标签的像素偏移,向下偏移20像素
           }
         });
-        this.viewer3D.entities.add({
+        this.$data._viewer3D.entities.add({
           id: this.id,
           position: position,
           point: {
@@ -832,7 +832,7 @@ export default {
                   pixelOffset: new this.Cesium.Cartesian2(0, 20) // 调整标签的像素偏移,向下偏移20像素
                 }
               });
-              this.viewer3D.entities.add({
+              this.$data._viewer3D.entities.add({
                 id: this.id,
                 position: position,
                 point: {

+ 11 - 11
src/views/situation/index.vue

@@ -616,7 +616,7 @@ export default {
     /* 地图放大 */
     big() {
       let { lon, lat, height } = this.getCenterPosition(this.dimension === 3);
-      let viewer = (this.dimension === 3 || this.dimension === 5)? this.viewer3D : this.viewer2D;
+      let viewer = (this.dimension === 3 || this.dimension === 5)? this.$data._viewer3D : this.$data._viewer2D;
       // 镜头拉进
       viewer.camera.flyTo({
         destination: this.Cesium.Cartesian3.fromDegrees(lon, lat, height / 1.8),
@@ -634,7 +634,7 @@ export default {
       });
     },
     home() {
-      let viewer = (this.dimension === 3 || this.dimension === 5)? this.viewer3D : this.viewer2D;
+      let viewer = (this.dimension === 3 || this.dimension === 5)? this.$data._viewer3D : this.$data._viewer2D;
       viewer.camera.flyTo({
         destination: this.Cesium.Cartesian3.fromDegrees(117.918977, 25.0, 1500000),
         duration: 2.0
@@ -766,7 +766,7 @@ export default {
       if (type == 'blue') {
         console.log(' radar!!!');
         const range = 100000;
-        this.viewer2D.entities.add({
+        this.$data._viewer2D.entities.add({
           id: this.id,
           position: position,
           ellipsoid: {
@@ -791,7 +791,7 @@ export default {
             pixelOffset: new this.Cesium.Cartesian2(0, 20) // 调整标签的像素偏移,向下偏移20像素
           }
         });
-        this.viewer3D.entities.add({
+        this.$data._viewer3D.entities.add({
           id: this.id,
           position: position,
   //         cylinder: {
@@ -831,7 +831,7 @@ export default {
         this.id++;
       }
       else {
-        this.viewer2D.entities.add({
+        this.$data._viewer2D.entities.add({
           id: this.id,
           position: position,
           point: {
@@ -850,7 +850,7 @@ export default {
             pixelOffset: new this.Cesium.Cartesian2(0, 20) // 调整标签的像素偏移,向下偏移20像素
           }
         });
-        this.viewer3D.entities.add({
+        this.$data._viewer3D.entities.add({
           id: this.id,
           position: position,
           point: {
@@ -876,7 +876,7 @@ export default {
         this.id++;
       }
 
-      console.log('this.viewer3D.entities :>> ', this.viewer3D.entities);
+      console.log('this.$data._viewer3D.entities :>> ', this.$data._viewer3D.entities);
     },
     // 从鼠标点击事件获取坐标
     getCoordinatesFromEvent(event) {
@@ -943,8 +943,8 @@ export default {
           }
         } else if (this.selectedMarker && this.modeltooltip === "右键取消") {
           // const material = new this.Cesium.PolylineArrowMaterialProperty(this.selectedMarker.point.color);
-          console.log('this.viewer2D.entities.values :>> ', this.viewer2D.entities.getById(this.selectedMarker.id).position._value);
-          let position = this.convertWorldToCartographic(this.viewer2D.entities.getById(this.selectedMarker.id).position._value)
+          console.log('this.$data._viewer2D.entities.values :>> ', this.$data._viewer2D.entities.getById(this.selectedMarker.id).position._value);
+          let position = this.convertWorldToCartographic(this.$data._viewer2D.entities.getById(this.selectedMarker.id).position._value)
         
           let name = ''
           for (let i = 0; i < this.nameIdList.length; i++) {
@@ -980,7 +980,7 @@ export default {
               // 新的终点坐标
               const newEndPoint = this.Cesium.Cartesian3.fromDegrees(position.longitude, position.latitude, position.height);
               // 遍历所有的entity对象
-              this.viewer2D.entities.values.forEach(entity => {
+              this.$data._viewer2D.entities.values.forEach(entity => {
                 // 检查entity是否为Polyline类型
                 if (entity instanceof this.Cesium.Entity && entity.polyline) {
                   // 获取原始的Polyline坐标数组
@@ -993,7 +993,7 @@ export default {
     entity.polyline.positions = new this.Cesium.CallbackProperty(time => positions, false);
   }
 });
-this.viewer3D.entities.values.forEach(entity => {
+this.$data._viewer3D.entities.values.forEach(entity => {
   // 检查entity是否为Polyline类型
   if (entity instanceof this.Cesium.Entity && entity.polyline) {
     // 获取原始的Polyline坐标数组