考虑性能问题暂去除正射图层

master
许宏杰 1 month ago
parent af0ff405f7
commit af9ad3da30

@ -22,16 +22,6 @@
<link href="./lib/mars3d/mars3d.css" rel="stylesheet" type="text/css" /> <link href="./lib/mars3d/mars3d.css" rel="stylesheet" type="text/css" />
<script src="./lib/mars3d/mars3d.js" type="text/javascript"></script> <script src="./lib/mars3d/mars3d.js" type="text/javascript"></script>
<script
src="./lib/mars3d/plugins/echarts/echarts.min.js"
type="text/javascript"
></script>
<script
src="./lib/mars3d/plugins/echarts/mars3d-echarts.js"
type="text/javascript"
></script>
<script src="./lib/localforage.js" type="text/javascript"></script> <script src="./lib/localforage.js" type="text/javascript"></script>
<script src="./lib/CesiumNetworkPlug.js" type="text/javascript"></script> <script src="./lib/CesiumNetworkPlug.js" type="text/javascript"></script>
<title><%= webpackConfig.name %></title> <title><%= webpackConfig.name %></title>

@ -57,6 +57,7 @@ export default {
mapLoad(map) { mapLoad(map) {
let _this = this; let _this = this;
this.map = map; this.map = map;
map.centerAt(this.config.viewHome, { map.centerAt(this.config.viewHome, {
complete: function () { complete: function () {
// //
@ -215,12 +216,13 @@ export default {
width: 70, width: 70,
height: 45, height: 45,
clampToGround: false, clampToGround: false,
visibleDepth: true,
label: { label: {
text: key, text: key,
font_size: 14, font_size: 14,
font_family: "黑体", font_family: "黑体",
color: "#ffffff", color: "#ffffff",
visibleDepth: false,
pixelOffsetY: -5, pixelOffsetY: -5,
background: true, background: true,
backgroundColor: "#000000", backgroundColor: "#000000",
@ -286,7 +288,7 @@ export default {
const { yuanName, buildingNumber, buildingColor, image } = const { yuanName, buildingNumber, buildingColor, image } =
this.pointFilter(item.attr); this.pointFilter(item.attr);
const polygon = new mars3d.graphic.PolygonEntity({ const polygon = new mars3d.graphic.PolygonEntity({
id: buildingNumber, id: item.attr["幢号"],
positions: item.positions, positions: item.positions,
style: { style: {
color: "transparent", color: "transparent",
@ -298,7 +300,7 @@ export default {
}); });
this.mapLayer.plane.addGraphic(polygon); this.mapLayer.plane.addGraphic(polygon);
const point = new mars3d.graphic.BillboardEntity({ const point = new mars3d.graphic.BillboardEntity({
id: buildingNumber, id: item.attr["幢号"],
position: polygon.centerPoint, position: polygon.centerPoint,
style: { style: {
image: image, image: image,
@ -409,10 +411,9 @@ export default {
}); });
this.map.addLayer(this.mapLayer.tiles3dLayer); this.map.addLayer(this.mapLayer.tiles3dLayer);
}, },
//3D //2D - 3D
handle3D() { handle3dPoint() {
this.mapLayer.tiles3dLayer.show = true; this.mapLayer.tiles3dLayer.show = true;
// //
this.mapLayer.planePoint.eachGraphic((graphic) => { this.mapLayer.planePoint.eachGraphic((graphic) => {
let attr = graphic.attr; let attr = graphic.attr;
@ -432,7 +433,6 @@ export default {
}); });
}); });
}, },
// //
addDTH() { addDTH() {
let geoJsonLayerDTH = new mars3d.layer.GeoJsonLayer({ let geoJsonLayerDTH = new mars3d.layer.GeoJsonLayer({
@ -456,6 +456,40 @@ export default {
}); });
this.map.addLayer(geoJsonLayerDTH); 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;
// }
// },
}, },
}; };
</script> </script>

@ -8,6 +8,7 @@
<div class="buttom-group"> <div class="buttom-group">
<button @click="handle3D()"></button> <button @click="handle3D()"></button>
<button @click="handlezs()"></button>
</div> </div>
</div> </div>
</template> </template>
@ -39,7 +40,10 @@ export default {
}, },
methods: { methods: {
handle3D() { handle3D() {
this.$refs.map.handle3D(); this.$refs.map.handle3dPoint();
},
handlezs() {
this.$refs.map.handlezs();
}, },
}, },
}; };

Loading…
Cancel
Save