From 9c2cad000f9279969e76bfc206a7acbb8acc9079 Mon Sep 17 00:00:00 2001 From: lixuliang <lixuliang_hd@126.com> Date: 星期一, 10 二月 2025 14:38:32 +0800 Subject: [PATCH] Merge branch 'master' of http://103.135.160.14:9034/r/PM20221203225_Web --- src/components/menu/tools/special.vue | 142 ++++++++++++++++++++++++++++++----------------- 1 files changed, 91 insertions(+), 51 deletions(-) diff --git a/src/components/menu/tools/special.vue b/src/components/menu/tools/special.vue index 1d9a7a8..9a0ac40 100644 --- a/src/components/menu/tools/special.vue +++ b/src/components/menu/tools/special.vue @@ -226,6 +226,7 @@ window.divPoint3 = null; window.instance = null; let tooltipHTML; +let tooltip; window.divPoint1 = null; window.pickFeature = null; window.imgUrl = null; @@ -565,6 +566,10 @@ sgworld.Creator.DeleteObject(buildingPolygon); buildingPolygon = null; } + if (tooltip) { + tooltip.show(false); + tooltip = null; + } if (nPickFeature.primitive instanceof Cesium.Billboard) { if (nPickFeature.id.length > 0) { return; @@ -708,7 +713,7 @@ this.$store.commit("description", obj); } - else if ( + else if (nPickFeature.id && nPickFeature.id.fid && nPickFeature.id.fid.includes("鍏嶈垂浣忔墍绌洪棿0131") ) { @@ -754,55 +759,90 @@ layuiLayer.close(SmartEarthPopupData.layerProp); this.$store.commit("description", obj); } - // else if (nPickFeature.primitive instanceof Cesium.Cesium3DTileset) { - // // let cartographic = - // // window.Viewer.scene.globe.ellipsoid.cartesianToCartographic( - // // nPickFeature.content.tile.boundingSphere.center - // // ); - // // let lon = Cesium.Math.toDegrees(cartographic.longitude); - // // let lat = Cesium.Math.toDegrees(cartographic.latitude); - // let p = sgworld.Navigate.getMouseDegrees(event); - // let lon = p.lon; - // let lat = p.lat; - // axios - // .get( - // "http://10.10.4.121:8070/gisserver/wfsserver/yizhuang-building-wfs-1207", - // { - // params: { - // version: "1.3.0", - // request: "GetFeature", - // typename: `浜﹀簞寤虹瓚澶栬疆寤�4326`, - // propertyname: "*", - // format: "json", - // filter: `<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml"><ogc:Intersects><ogc:PropertyName>SAHEP</ogc:PropertyName><gml:Point > <gml:pos>${lon} ${lat}</gml:pos></gml:Point></ogc:Intersects></ogc:Filter>` - // } - // } - // ) - // .then(response => { - // if (response.data.features.length > 0) { - // var geometry = []; - // let POIs = response.data.features[0].geometry.coordinates[0]; - // for (let i = 0; i < POIs.length; i++) { - // geometry.push({ - // x: parseFloat(POIs[i][0]), - // y: parseFloat(POIs[i][1]), - // z: 0 - // }); - // } - // buildingPolygon = sgworld.Creator.createPolygon( - // geometry, - // { - // fillColor: "#00ff0050", - // outlineColor: "#ff0000", - // outlineWidth: 2 - // }, - // 1, - // 0, - // "闈�" - // ); - // } - // }); - // } + else if (nPickFeature.primitive instanceof Cesium.Cesium3DTileset) { + // let cartographic = + // window.Viewer.scene.globe.ellipsoid.cartesianToCartographic( + // nPickFeature.content.tile.boundingSphere.center + // ); + // let lon = Cesium.Math.toDegrees(cartographic.longitude); + // let lat = Cesium.Math.toDegrees(cartographic.latitude); + + let p = sgworld.Navigate.getMouseDegrees(event); + let lon = p.lon; + let lat = p.lat; + + + axios + .get( + "http://10.10.4.121:8070/gisserver/wfsserver/yizhuang-buliding-wfs", + { + params: { + version: "1.3.0", + request: "GetFeature", + typename: `鍗曚綋鍖朣HP20241029_wgs84`, + propertyname: "*", + format: "json", + filter: `<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml"><ogc:Intersects><ogc:PropertyName>SAHEP</ogc:PropertyName><gml:Point > <gml:pos>${lon} ${lat}</gml:pos></gml:Point></ogc:Intersects></ogc:Filter>` + } + } + ) + .then(response => { + if (response.data.features.length > 0) { + var geometry = []; + let POIs = response.data.features[0].geometry.coordinates[0]; + tooltipHTML = ""; + + for (let i in response.data.features[0].properties) { + let value = response.data.features[0].properties[i]; + + + value && (tooltipHTML += `<p>${i}锛�${value || "鏃�"}</p>`); + } + + if (tooltip) { + tooltip.show(false); + tooltip = null; + } + tooltip = sgworld.Core.CreateResultTooltip(window.Viewer, { + color: "black", + addY: 0, + far: 200000, + closeBtn: true, + close: () => { + if (buildingPolygon) { + sgworld.Creator.DeleteObject(buildingPolygon); + buildingPolygon = null; + } + }, + }); + + + let description = `<div style=' border: 1px solid #fff;border-radius: 5px;background: rgba(0, 0, 0, 0.8);color: #fff;padding: 15px;'>${tooltipHTML}</div>`; + tooltip.showAt( + Cesium.Cartesian3.fromDegrees(p.lon, p.lat, 0), + description + ); + for (let i = 0; i < POIs.length; i++) { + geometry.push({ + x: parseFloat(POIs[i][0]), + y: parseFloat(POIs[i][1]), + z: 0 + }); + } + buildingPolygon = sgworld.Creator.createPolygon( + geometry, + { + fillColor: "#00ff0050", + outlineColor: "#ff0000", + outlineWidth: 2 + }, + 1, + 0, + "闈�" + ); + } + }); + } // else if (nPickFeature.primitive instanceof Cesium.GroundPrimitive) { // let wmsLayer = this.$store.state.selectedLayers.filter((item) => { // return item.name == "琛屾斂鍖哄垝鍥�"; @@ -812,7 +852,7 @@ // axios // .get( - // "http://10.10.4.116:8070/gisserver/rest/services/XingZhengQuHuaTu/MapServer/identify", + // "https://skyzt.bda.gov.cn/gisserver/rest/services/XingZhengQuHuaTu/MapServer/identify", // { // params: { // geometry: `${p.lon},${p.lat}`, -- Gitblit v1.9.3