From af9ad3da30423834e96273bd5b6ce90a318d185a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AE=8F=E6=9D=B0?= <1943105267@qq.com> Date: Wed, 21 Aug 2024 16:49:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E8=99=91=E6=80=A7=E8=83=BD=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E6=9A=82=E5=8E=BB=E9=99=A4=E6=AD=A3=E5=B0=84=E5=9B=BE?= =?UTF-8?q?=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 10 ----- src/views/components/xiaoqu/map/index.vue | 48 +++++++++++++++++++---- src/views/xiaoqu.vue | 6 ++- 3 files changed, 46 insertions(+), 18 deletions(-) diff --git a/public/index.html b/public/index.html index 1d17178..23fd728 100644 --- a/public/index.html +++ b/public/index.html @@ -22,16 +22,6 @@ - - - - <%= webpackConfig.name %> diff --git a/src/views/components/xiaoqu/map/index.vue b/src/views/components/xiaoqu/map/index.vue index 59977b9..c0f38c0 100644 --- a/src/views/components/xiaoqu/map/index.vue +++ b/src/views/components/xiaoqu/map/index.vue @@ -57,6 +57,7 @@ export default { mapLoad(map) { let _this = this; this.map = map; + map.centerAt(this.config.viewHome, { complete: function () { //加载图层数据 @@ -215,12 +216,13 @@ export default { width: 70, height: 45, clampToGround: false, - visibleDepth: true, + label: { text: key, font_size: 14, font_family: "黑体", color: "#ffffff", + visibleDepth: false, pixelOffsetY: -5, background: true, backgroundColor: "#000000", @@ -286,7 +288,7 @@ export default { const { yuanName, buildingNumber, buildingColor, image } = this.pointFilter(item.attr); const polygon = new mars3d.graphic.PolygonEntity({ - id: buildingNumber, + id: item.attr["幢号"], positions: item.positions, style: { color: "transparent", @@ -298,7 +300,7 @@ export default { }); this.mapLayer.plane.addGraphic(polygon); const point = new mars3d.graphic.BillboardEntity({ - id: buildingNumber, + id: item.attr["幢号"], position: polygon.centerPoint, style: { image: image, @@ -409,10 +411,9 @@ export default { }); this.map.addLayer(this.mapLayer.tiles3dLayer); }, - //3D - handle3D() { + //2D - 3D点处理 + handle3dPoint() { this.mapLayer.tiles3dLayer.show = true; - //修改二维图标成为三维 this.mapLayer.planePoint.eachGraphic((graphic) => { let attr = graphic.attr; @@ -432,7 +433,6 @@ export default { }); }); }, - //单体化 addDTH() { let geoJsonLayerDTH = new mars3d.layer.GeoJsonLayer({ @@ -456,6 +456,40 @@ export default { }); this.map.addLayer(geoJsonLayerDTH); }, + + // handlezs() { + // // this.mapLayer.zhengsheLayer.show = true; + // this.addZhengsheLayer(); + // }, + // //正射图层 + // addZhengsheLayer() { + // if (!window.zhengsheLayer) { + // // 加载正射影像 + // window.zhengsheLayer = new mars3d.layer.WmsLayer({ + // show: false, + // url: this.config.zhengshe.url, + // layers: this.config.zhengshe.layers, + // parameters: { + // transparent: true, + // format: "image/png", + // }, + // // bbox: [ + // // 608648.6336036972, 3481287.392025131, 609648.8066657612, + // // 3482195.491969689, + // // ], + // // srs: "EPSG:4549", + // // brightness: 0.9, + // // contrast: 0.9, // 对比度 + // // saturation: 0.9, + // // gamma: 0.9, + // // tileWidth: 64, + // // tileHeight: 64, + // }); + // this.map.addLayer(window.zhengsheLayer); + + // window.zhengsheLayer.show = true; + // } + // }, }, }; diff --git a/src/views/xiaoqu.vue b/src/views/xiaoqu.vue index a61fcd3..d89d5a3 100644 --- a/src/views/xiaoqu.vue +++ b/src/views/xiaoqu.vue @@ -8,6 +8,7 @@
+
@@ -39,7 +40,10 @@ export default { }, methods: { handle3D() { - this.$refs.map.handle3D(); + this.$refs.map.handle3dPoint(); + }, + handlezs() { + this.$refs.map.handlezs(); }, }, };