소스 검색

失真问题

zpf 10 달 전
부모
커밋
e0a08274c8
1개의 변경된 파일7개의 추가작업 그리고 6개의 파일을 삭제
  1. 7 6
      src/components/Query/clickQuery/CockpitVector.vue

+ 7 - 6
src/components/Query/clickQuery/CockpitVector.vue

@@ -20,6 +20,7 @@
 import { QueryList } from '@/api/cockpitNew'
 import * as wellknown from "wellknown";
 import * as turf from "@turf/turf";
+let pick_entity = null;
 export default {
   components: {},
   data() {
@@ -117,7 +118,7 @@ export default {
           const twoDArray = geojson.coordinates[0];
           const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
           console.log('oneDArray: ', oneDArray);
-          that.pick_entity.entities.add({
+          pick_entity.entities.add({
             polygon: {
               // 获取指定属性(positions,holes(图形内需要挖空的区域))
               hierarchy: {
@@ -151,9 +152,9 @@ export default {
           }, 500);
           setTimeout(() => {
             clearInterval(time);
-            this.pick_entity.entities.values.forEach((res) => {
+            pick_entity.entities.values.forEach((res) => {
 
-              this.pick_entity.entities.remove(res);
+              pick_entity.entities.remove(res);
 
             })
           }, 6000)
@@ -189,7 +190,7 @@ export default {
 
     },
     switch_show(flag) {
-      this.pick_entity.entities.values.forEach((res) => {
+      pick_entity.entities.values.forEach((res) => {
         res.show = flag;
       })
     },
@@ -201,8 +202,8 @@ export default {
     const that = this;
     this.$nextTick(() => {
 
-      that.pick_entity = new Cesium.CustomDataSource("pick_entity");
-      viewer.dataSources.add(that.pick_entity);
+      pick_entity = new Cesium.CustomDataSource("pick_entity");
+      viewer.dataSources.add(pick_entity);
     }); //生命周期 - 挂在完成
   }, //生命周期 - 挂在完成
   beforeUpdate() { }, //生命周期 - 更新之前