From 1187e68726f1c619a25768edd08c6080e72e903c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AE=8F=E6=9D=B0?= <1943105267@qq.com> Date: Tue, 20 Aug 2024 10:12:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E5=8C=BA=E7=BD=91=E6=A0=BC=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/xiaoqu/map/index.vue | 36 +++++++++++++++++++---- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/src/views/components/xiaoqu/map/index.vue b/src/views/components/xiaoqu/map/index.vue index 740576f..c8b7d23 100644 --- a/src/views/components/xiaoqu/map/index.vue +++ b/src/views/components/xiaoqu/map/index.vue @@ -73,14 +73,15 @@ export default { this.mapLayer.planePoint = new mars3d.layer.GraphicLayer(); this.map.addLayer(this.mapLayer.planePoint); + + this.mapLayer.network = new mars3d.layer.GraphicLayer(); + this.map.addLayer(this.mapLayer.network); }, addMapLayer() { this.mapGraphicLayer(); - if (this.xiaoquId == 267) { this.addshop(); } - if ( this.xiaoquId === 202 || this.xiaoquId === 245 || @@ -89,8 +90,9 @@ export default { ) { this.addGardenLayer(); } + // this.addbuildingLayer(); - this.addbuildingLayer(); + this.addNetworkLayer(); }, //商铺面 addshop() { @@ -222,7 +224,6 @@ export default { this.mapLayer.garden.addGraphic(graphic); }); }, - pointFilter(attr) { let data = garden[this.xiaoquId]; let yuanName = ""; @@ -259,7 +260,6 @@ export default { return { yuanName, buildingNumber, buildingColor, image }; }, - //平面 + 图标 addbuildingLayer() { let _this = this; @@ -334,6 +334,32 @@ export default { }); }); }, + + //小区网格面 + addNetworkLayer() { + mars3d.Util.fetchJson({ + url: this.configUrl + `lib/geoJson/xiaoqu/network${this.xiaoquId}.json`, + }).then((res) => { + const arr = mars3d.Util.geoJsonToGraphics(res); + + arr.map((item, index) => { + let polygon = new mars3d.graphic.PolygonEntity({ + positions: item.positions, + style: { + color: "#005AFF", + opacity: 0.2, + clampToGround: true, + classification: true, + buffer: 1, + outline: true, + outlineWidth: 3, + outlineColor: "#32FF85", + }, + }); + this.mapLayer.network.addGraphic(polygon); + }); + }); + }, }, };