浏览代码

颜色失真修改

maxiaoxiao 10 月之前
父节点
当前提交
03ac481dff
共有 1 个文件被更改,包括 13 次插入13 次删除
  1. 13 13
      src/components/Query/clickQuery/clickQuery.vue

+ 13 - 13
src/components/Query/clickQuery/clickQuery.vue

@@ -106,7 +106,7 @@ import * as turf from "@turf/turf";
 let gwtype;
 let gwtype;
 let query_click = null;
 let query_click = null;
 let manager_layer_png = null;
 let manager_layer_png = null;
-
+let dataSourceLayer =null
 export default {
 export default {
   name: "clickQuery",
   name: "clickQuery",
   components: { CockpitVector, MultiLevelQuery },
   components: { CockpitVector, MultiLevelQuery },
@@ -136,7 +136,7 @@ export default {
       queryResultsGeom: {},
       queryResultsGeom: {},
       queryResultsGeomPart: {},
       queryResultsGeomPart: {},
       viewer: null,
       viewer: null,
-      dataSourceLayer: null,
+      // dataSourceLayer: null,
       actionOptions: [
       actionOptions: [
         {
         {
           index: 1,
           index: 1,
@@ -203,10 +203,10 @@ export default {
       if (!this.inited) {
       if (!this.inited) {
         this.inited = !this.inited;
         this.inited = !this.inited;
         this.viewer = viewer;
         this.viewer = viewer;
-        this.viewer.entities.removeAll();
+        viewer.entities.removeAll();
         this.handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
         this.handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
-        this.dataSourceLayer = new Cesium.CustomDataSource("query");
-        this.viewer.dataSources.add(this.dataSourceLayer);
+        dataSourceLayer = new Cesium.CustomDataSource("query");
+        this.viewer.dataSources.add(dataSourceLayer);
       }
       }
     },
     },
   },
   },
@@ -245,7 +245,7 @@ export default {
     },
     },
     addGeometrys(fill) {
     addGeometrys(fill) {
       this.viewer.entities.removeAll();
       this.viewer.entities.removeAll();
-      this.dataSourceLayer.entities.removeAll();
+      dataSourceLayer.entities.removeAll();
       let geoms = this.queryResultsGeom[this.activeLayerId];
       let geoms = this.queryResultsGeom[this.activeLayerId];
       let parts = this.queryResultsGeomPart[this.activeLayerId];
       let parts = this.queryResultsGeomPart[this.activeLayerId];
       for (let i = 0; i < geoms.length; i++) {
       for (let i = 0; i < geoms.length; i++) {
@@ -300,7 +300,7 @@ export default {
       }
       }
     },
     },
     flyTo(index) {
     flyTo(index) {
-      this.dataSourceLayer.entities.removeAll();
+      dataSourceLayer.entities.removeAll();
       let geoms = this.queryResultsGeom[this.activeLayerId];
       let geoms = this.queryResultsGeom[this.activeLayerId];
       let parts = this.queryResultsGeomPart[this.activeLayerId];
       let parts = this.queryResultsGeomPart[this.activeLayerId];
       let cur = geoms[index];
       let cur = geoms[index];
@@ -320,7 +320,7 @@ export default {
             points.push(cx);
             points.push(cx);
             points.push(cy);
             points.push(cy);
           }
           }
-          // let e = this.dataSourceLayer.entities.
+          // let e = dataSourceLayer.entities.
           let e = this.viewer.entities.add({
           let e = this.viewer.entities.add({
             polyline: new Cesium.PolylineGraphics({
             polyline: new Cesium.PolylineGraphics({
               positions: Cesium.Cartesian3.fromDegreesArray(points),
               positions: Cesium.Cartesian3.fromDegreesArray(points),
@@ -343,8 +343,8 @@ export default {
     },
     },
     // 设置数据
     // 设置数据
     setData() {
     setData() {
-      this.dataSourceLayer = new Cesium.CustomDataSource("query");
-      this.viewer.dataSources.add(this.dataSourceLayer);
+      dataSourceLayer = new Cesium.CustomDataSource("query");
+      this.viewer.dataSources.add(dataSourceLayer);
       this.activeLayerId = "0";
       this.activeLayerId = "0";
       this.queryResults = {};
       this.queryResults = {};
       this.queryResultsGeom = {};
       this.queryResultsGeom = {};
@@ -667,7 +667,7 @@ export default {
       this.layerList = [];
       this.layerList = [];
       this.layersData = [];
       this.layersData = [];
       this.viewer.entities.removeAll();
       this.viewer.entities.removeAll();
-      this.dataSourceLayer.entities.removeAll();
+      dataSourceLayer.entities.removeAll();
       let title;
       let title;
       if (store.state.checkedData) title = store.state.checkedData.title;
       if (store.state.checkedData) title = store.state.checkedData.title;
       //  超图分层分户
       //  超图分层分户
@@ -757,8 +757,8 @@ export default {
       this.viewer.entities.removeAll();
       this.viewer.entities.removeAll();
       this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
       this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
       this.handler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK);
       this.handler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK);
-      this.dataSourceLayer.entities.removeAll();
-      this.viewer.dataSources.remove(this.dataSourceLayer);
+      dataSourceLayer.entities.removeAll();
+      this.viewer.dataSources.remove(dataSourceLayer);
     },
     },
     /**
     /**
      * 笛卡尔坐标系转WGS84坐标系(经纬度)
      * 笛卡尔坐标系转WGS84坐标系(经纬度)