maxiaoxiao 9 ماه پیش
والد
کامیت
ba80894c70
2فایلهای تغییر یافته به همراه14 افزوده شده و 5 حذف شده
  1. 13 4
      src/components/Query/clickQuery/clickQuery.vue
  2. 1 1
      src/utils/MapHelper/help.js

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

@@ -844,7 +844,7 @@ export default {
       this.queryResultsGeom = {};
       this.queryResultsGeomPart = {};
       this.layerList = [];
-      viewer.entities.removeAll();
+      // viewer.entities.removeAll();
       if (this.handler.removeInputAction) {
         this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
         this.handler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK);
@@ -917,8 +917,7 @@ export default {
         case 1: {
           this.mapQuerys("mapLayerQuery"); //图层点击事件
           this.remove_query_click();
-          viewer.entities.removeAll();
-          // common.clearHandlerDrawing("Polygon");
+          // viewer.entities.removeAll();
           break;
         }
         case 2: {
@@ -932,7 +931,7 @@ export default {
           this.$refs.MultiLevelQuery.clear_data(); //多级查询
 
           this.remove_query_click();
-
+          common.clearHandlerDrawing("Polygon");
           break;
         }
         case 4: {
@@ -958,11 +957,21 @@ export default {
     },
     //绘制
     drawMap() {
+      let that = this;
+      this.activeLayerId = "0";
+      this.layerList = [];
+      this.layersData = [];
+      // this.remove_query_click();
+      // let scene = viewer.scene;
+      // viewer.entities.removeAll();
+      // dataSourceLayer.entities.removeAll();
+      removeGeoJSON("geoserver");
       if (!window.handlerPolygon) {
         common.initHandler("Polygon");
       }
       common.handlerDrawing("Polygon").then(
         (res) => {
+          removeGeoJSON("geoserver");
           store.state.vectorlayerlist.forEach((obj) => {
             if (obj.serverType == "geoserver") {
               let points = "";

+ 1 - 1
src/utils/MapHelper/help.js

@@ -93,7 +93,7 @@ export function removeGeoJSON(name) {
     var das = viewer.dataSources._dataSources[i];
     if (das.name == name) viewer.dataSources.remove(das);
   }
-},
+}
 export function addPonit() {
   // manager_multi_level_query.entities.add({
   //   name: "manager_multi_level_query",