浏览代码

Merge branch 'master' of http://114.244.114.158:8802/siwei/real3d-portalsite

lkk 6 月之前
父节点
当前提交
08f2633c6f
共有 1 个文件被更改,包括 34 次插入1 次删除
  1. 34 1
      src/components/Query/clickQuery/clickQuery.vue

+ 34 - 1
src/components/Query/clickQuery/clickQuery.vue

@@ -913,6 +913,7 @@ export default {
           this.mapQuerys("mapLayerQuery"); //图层点击事件
           this.remove_query_click();
           viewer.entities.removeAll();
+          common.clearHandlerDrawing("Polygon");
           break;
         }
         case 2: {
@@ -942,7 +943,7 @@ export default {
         case 6: {
           //联级查询
           // this.$refs.MultiLevelQuery.init_handler();
-          this.mapQuerys("mapSelect"); //图层点击事件
+          this.drawMap();
           console.log("框选事件");
           break;
         }
@@ -950,6 +951,38 @@ export default {
           break;
       }
     },
+    //绘制
+    drawMap() {
+      if (!window.handlerPolygon) {
+        common.initHandler("Polygon");
+      }
+      common.handlerDrawing("Polygon").then(
+        (res) => {
+          // console.log(res.positions, "------");
+          //过滤掉高度
+          const filteredArr = res.positions.filter((item, index) => {
+            if ((index + 1) % 3 !== 0) return item;
+          });
+          filteredArr.push(res.positions[0]);
+          filteredArr.push(res.positions[1]);
+          console.log(filteredArr, "max-----");
+          store.state.vectorlayerlist.forEach((obj) => {
+            if (obj.serverType == "geoserver") {
+              // this.getGeoserver(xy, obj);
+            } else {
+              //     if (!obj.fwgzkj && !obj.fwmc) {
+              //   continue;
+              // }
+              // this.superQuery(xy, obj);
+            }
+          });
+        },
+        (err) => {
+          console.log(err);
+        }
+      );
+      window.handlerPolygon.activate();
+    },
   },
   beforeDestroy() {
     this.removeMapLayerQuery();