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(); }, }, };