瀏覽代碼

数据查询

maxiaoxiao 11 月之前
父節點
當前提交
062e052a51
共有 1 個文件被更改,包括 7 次插入14 次删除
  1. 7 14
      src/components/Query/clickQuery/clickQuery.vue

+ 7 - 14
src/components/Query/clickQuery/clickQuery.vue

@@ -241,6 +241,7 @@ export default {
     toggleVisibility() {
       this.removeMapLayerQuery();
       this.remove_query_click();
+      this.removeGeoJSON();
       store.setToolBarAction(9);
       tdsy.remove(false);
     },
@@ -514,7 +515,6 @@ export default {
         // 结果高亮
         this.highlightResultsPng(xy.lng, xy.lat);
         if (obj.serverType == "geoserver") {
-          console.log("----", obj);
           this.getGeoserver(xy, obj);
         } else {
           if (!obj.source) {
@@ -632,28 +632,21 @@ export default {
       }
     },
     async getGeoserver(xy, obj) {
-      // url: obj.url, //'http://192.168.60.52:28085/geoserver/gwc/service/wmts';
-console.log("---a--a--a-a")
       this.queryResults[obj.id] = [];
       this.queryResultsGeom[obj.id] = [];
-      let url = `${obj.url.substring(0, obj.url.indexOf("geoserver"))}/demo/wms`; //"http://192.168.60.52:28085/geoserver/wms";
+      let url = obj.url.substring(0, obj.url.indexOf("geoserver") + 9) + "/wms";
       let params = {
         service: "WMS",
         version: "1.1.1",
         request: "GetFeatureInfo",
-        // FORMAT: "image/png",
-        transparent: true,
-        query_layers: `${obj.fwgzkj}:${obj.fwmc}`,
-        // STYLES: "",
         layers: `${obj.fwgzkj}:${obj.fwmc}`,
-        // exceptions: "application/vnd.ogc.se_inimage",
+        query_layers: `${obj.fwgzkj}:${obj.fwmc}`,
         info_format: "application/json",
-        // FEATURE_COUNT: 50,
-        x: 19,
-        y: 174,
         srs: "EPSG:4326",
-        width: 256,
-        height: 256,
+        x: 50,
+        y: 50,
+        width: 101,
+        height: 101,
         bbox: bbox(xy, 10), // "12152284.626610054,2080930.4355590942,12153248.563804159,2081894.3727532008",
       };
       let res = await axios.get(url, { params });