小区网格面

master
许宏杰 1 month ago
parent 05cd70ab27
commit 1187e68726

@ -73,14 +73,15 @@ export default {
this.mapLayer.planePoint = new mars3d.layer.GraphicLayer(); this.mapLayer.planePoint = new mars3d.layer.GraphicLayer();
this.map.addLayer(this.mapLayer.planePoint); this.map.addLayer(this.mapLayer.planePoint);
this.mapLayer.network = new mars3d.layer.GraphicLayer();
this.map.addLayer(this.mapLayer.network);
}, },
addMapLayer() { addMapLayer() {
this.mapGraphicLayer(); this.mapGraphicLayer();
if (this.xiaoquId == 267) { if (this.xiaoquId == 267) {
this.addshop(); this.addshop();
} }
if ( if (
this.xiaoquId === 202 || this.xiaoquId === 202 ||
this.xiaoquId === 245 || this.xiaoquId === 245 ||
@ -89,8 +90,9 @@ export default {
) { ) {
this.addGardenLayer(); this.addGardenLayer();
} }
// this.addbuildingLayer();
this.addbuildingLayer(); this.addNetworkLayer();
}, },
// //
addshop() { addshop() {
@ -222,7 +224,6 @@ export default {
this.mapLayer.garden.addGraphic(graphic); this.mapLayer.garden.addGraphic(graphic);
}); });
}, },
pointFilter(attr) { pointFilter(attr) {
let data = garden[this.xiaoquId]; let data = garden[this.xiaoquId];
let yuanName = ""; let yuanName = "";
@ -259,7 +260,6 @@ export default {
return { yuanName, buildingNumber, buildingColor, image }; return { yuanName, buildingNumber, buildingColor, image };
}, },
// + // +
addbuildingLayer() { addbuildingLayer() {
let _this = this; 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);
});
});
},
}, },
}; };
</script> </script>

Loading…
Cancel
Save