From c6d2c07a595f741fc33301a537820173f95e38cf Mon Sep 17 00:00:00 2001 From: WX <1377869194@qq.com> Date: 星期四, 21 九月 2023 09:52:13 +0800 Subject: [PATCH] 修改标绘查询 --- src/assets/js/Map/index.js | 15 ++++--- src/assets/js/Map/server.js | 81 +++++++++++++++++++++++++--------------- src/views/plotting/plottingInquire.vue | 14 +++++-- src/views/plotting/plotting.vue | 1 4 files changed, 69 insertions(+), 42 deletions(-) diff --git a/src/assets/js/Map/index.js b/src/assets/js/Map/index.js index a51a32a..a45722f 100644 --- a/src/assets/js/Map/index.js +++ b/src/assets/js/Map/index.js @@ -9,14 +9,17 @@ graticules: null, //鍦板浘鍒濆鍖� init3DMap() { - SmartEarth.Cesium.ExternalParameter.eliminate = false - SmartEarth.Cesium.ExternalParameter.changeApproximateTerrainHeights = true + SmartEarth.Cesium.ExternalParameter.eliminate = false; + SmartEarth.Cesium.ExternalParameter.changeApproximateTerrainHeights = true; SmartEarth.Cesium.ExternalParameter.maxTerrainHeight = 2000000; SmartEarth.Cesium.ExternalParameter.minTerrainHeight = -2000000; SmartEarth.Cesium.ShadowMap.MAXIMUM_DISTANCE = 20000000000; - window.Cesium = SmartEarth.Cesium - SmartEarth.Cesium.Ellipsoid.WGS84 = new SmartEarth.Cesium.Ellipsoid(1737400.0, 1737400.0, 1737400.0) - + window.Cesium = SmartEarth.Cesium; + SmartEarth.Cesium.Ellipsoid.WGS84 = new SmartEarth.Cesium.Ellipsoid( + 1737400.0, + 1737400.0, + 1737400.0 + ); //椤甸潰鍒濆鍖� this.earthCtrl = new SmartEarth.EarthCtrl("cesiumContainer", { @@ -25,7 +28,7 @@ timeline: true, }); - this.earthCtrl.Viewer.scene.debugShowFramesPerSecond = true + this.earthCtrl.Viewer.scene.debugShowFramesPerSecond = true; this.earthCtrl.coreMap.scene.screenSpaceCameraController.enableCollisionDetection = true; window.earthCtrl = this.earthCtrl; diff --git a/src/assets/js/Map/server.js b/src/assets/js/Map/server.js index ccce9ab..c99d8b5 100644 --- a/src/assets/js/Map/server.js +++ b/src/assets/js/Map/server.js @@ -23,7 +23,11 @@ }, showlonlatLine() { if (!this.graticules) { - SmartEarth.Cesium.Ellipsoid.WGS84 = new SmartEarth.Cesium.Ellipsoid(1737400.0, 1737400.0, 1737400.0) + SmartEarth.Cesium.Ellipsoid.WGS84 = new SmartEarth.Cesium.Ellipsoid( + 1737400.0, + 1737400.0, + 1737400.0 + ); this.graticules = new SmartEarth.Cesium.Graticules( earthCtrl.Viewer, @@ -35,10 +39,8 @@ that.graticules.update(); }); } else { - this.graticules.enabled = !this.graticules.enabled + this.graticules.enabled = !this.graticules.enabled; } - - }, //浠g悊鍦板潃 addProxyAddress(res) { @@ -267,7 +269,6 @@ tilingScheme: new Cesium.GeographicTilingScheme({ ellipsoid: Cesium.Ellipsoid.MOON, }), - }); Viewer.terrainProvider = window.terrainLayer; Viewer.scene.globe.terrainExaggeration = 1.0000001; @@ -360,7 +361,7 @@ ); break; case "tileset": - window.Viewer.scene.primitives.remove(e.layerData) + window.Viewer.scene.primitives.remove(e.layerData); break; } this.layerList.splice(i, 1); @@ -383,24 +384,27 @@ ); break; case "tileset": - window.Viewer.scene.primitives.remove(e.layerData) + window.Viewer.scene.primitives.remove(e.layerData); break; } this.layerList.splice(i, 1); }); - }, //鍔犺浇GeoServer-WMS鏈嶅姟 setAddGeoWmsLayer(res) { var url = this.getLayrUrl(res); - var that = this - var getFeatureInfoFormat = new SmartEarth.Cesium.GetFeatureInfoFormat("html", null, function (html) { - that.getFeatureInfo(html) - }); + var that = this; + var getFeatureInfoFormat = new SmartEarth.Cesium.GetFeatureInfoFormat( + "html", + null, + function (html) { + that.getFeatureInfo(html); + } + ); let layer = new SmartEarth.Cesium.WebMapServiceImageryProvider({ url: url, layers: res.tab, - getFeatureInfoParameters: { info_format: 'text/html' }, + getFeatureInfoParameters: { info_format: "text/html" }, enablePickFeatures: true, getFeatureInfoFormats: [getFeatureInfoFormat], parameters: { @@ -418,14 +422,18 @@ this.layerList.push({ id: res.id, layerData: img_layer, type: "wmts" }); }, addGeoServerMmsLayers(layer, url) { - var that = this - var getFeatureInfoFormat = new SmartEarth.Cesium.GetFeatureInfoFormat("html", null, function (html) { - that.getFeatureInfo(html) - }); + var that = this; + var getFeatureInfoFormat = new SmartEarth.Cesium.GetFeatureInfoFormat( + "html", + null, + function (html) { + that.getFeatureInfo(html); + } + ); let wmslayer = new SmartEarth.Cesium.WebMapServiceImageryProvider({ url: url, layers: layer.toString(), - getFeatureInfoParameters: { info_format: 'text/html' }, + getFeatureInfoParameters: { info_format: "text/html" }, enablePickFeatures: true, getFeatureInfoFormats: [getFeatureInfoFormat], parameters: { @@ -442,35 +450,46 @@ this.layerList.push({ id: 1001011, layerData: img_layer, type: "wmts" }); }, - getFeatureInfo(html) { store.state.details.showDetails = false; - var start = html.indexOf("<caption class=\"featureInfo\">") + "<caption class=\"featureInfo\">".length; + var start = + html.indexOf('<caption class="featureInfo">') + + '<caption class="featureInfo">'.length; var end = html.indexOf("</caption>"); var tab = html.substr(start, end - start); - var std = html.substr(html.indexOf('<th>'), html.lastIndexOf('</th>') - html.indexOf('<th>') + 5).replaceAll(' ', '').replaceAll('\n', '').split('</th>') + var std = html + .substr( + html.indexOf("<th>"), + html.lastIndexOf("</th>") - html.indexOf("<th>") + 5 + ) + .replaceAll(" ", "") + .replaceAll("\n", "") + .split("</th>"); var gindex = null; for (var i = 0; i < std.length; i++) { - if (std[i].indexOf('gid') > -1) { + if (std[i].indexOf("gid") > -1) { gindex = i; break; } } - if (!gindex) return - var str = html.substr(html.indexOf('<td>'), html.lastIndexOf('</td>') - html.indexOf('<td>') + 5).replaceAll(' ', '').replaceAll('\n', '').split('</td>') - var gid = parseInt(str[gindex].replaceAll( - '<td>', '' - )) + if (!gindex) return; + var str = html + .substr( + html.indexOf("<td>"), + html.lastIndexOf("</td>") - html.indexOf("<td>") + 5 + ) + .replaceAll(" ", "") + .replaceAll("\n", "") + .split("</td>"); + var gid = parseInt(str[gindex].replaceAll("<td>", "")); if (gid && tab) { - store.state.details = { gid: gid, tab: tab, - showDetails: true - } + showDetails: true, + }; } - }, }; export default server; diff --git a/src/views/plotting/plotting.vue b/src/views/plotting/plotting.vue index f049424..e3e96a2 100644 --- a/src/views/plotting/plotting.vue +++ b/src/views/plotting/plotting.vue @@ -253,7 +253,6 @@ emits("setCloseplotting", false); }; const resultShow = (res) => { - console.log(res); let obj = { isshow: true, entitiesData: res, diff --git a/src/views/plotting/plottingInquire.vue b/src/views/plotting/plottingInquire.vue index 65c8b01..a402468 100644 --- a/src/views/plotting/plottingInquire.vue +++ b/src/views/plotting/plottingInquire.vue @@ -126,19 +126,23 @@ </div> </div> - <div class="inquireContent_msg" v-if="!chartIsshow"> + <!-- <div + class="inquireContent_msg" + v-if="!chartIsshow" + v-show="pixelIsShow" + > <div class="inquireContent_msg_k"> <span>鎻愬彇鐨勮竟鐣屾</span> <span>{{ ScopeBox.pixel }}脳{{ ScopeBox.pixel }}</span> </div> - <!-- <div class="inquireContent_msg_k"> + <div class="inquireContent_msg_k"> <span>浣跨敤</span> <span >{{ ScopeBox.Scop * 1000 }}.00,{{ ScopeBox.Scop * 1000 }}.00 m/px</span > - </div> --> - </div> + </div> + </div> --> <div class="inquireContent_table" v-if="!chartIsshow"> <div class="table"> <div class="table_head"> @@ -510,6 +514,7 @@ isShow.value = nVal.isshow; inquireData.value = nVal.entitiesData; if (nVal.entitiesData.icon == "x.png") { + pixelIsShow.value = true; selectPolyline({ nodes: ScopeBox.value.nodes, wkt: nVal.entitiesData.wkt, @@ -525,6 +530,7 @@ } if (nVal && nVal.entitiesData.icon == "d.png") { chartIsshow.value = false; + pixelIsShow.value = true; selectPoint({ pixel: ScopeBox.value.pixel, wkt: nVal.entitiesData.wkt, -- Gitblit v1.9.3