function addDemoGraphic1(graphicLayer) {
const graphic = new mars3d.graphic.PolylineVolumeEntity({
positions: [
[
116.323737,
30.982493,
1268.8
],
[
116.322162,
30.981753,
1248.1
],
[
116.321032,
30.981446,
1207.9
],
[
116.31831,
30.976752,
1380.2
],
[
116.316009,
30.973638,
1474.2
],
[
116.3141,
30.973489,
1341.9
],
[
116.313154,
30.972897,
1281.3
],
[
116.312203,
30.972234,
1236.2
],
[
116.311222,
30.970596,
1233
],
[
116.310812,
30.969438,
1192.2
],
[
116.310177,
30.968137,
1136.4
],
[
116.309501,
30.966755,
1038.9
],
[
116.30903,
30.965737,
975.8
],
[
116.307575,
30.960527,
1145.5
],
[
116.307275,
30.95977,
1098.3
],
[
116.306986,
30.958758,
1031.6
],
[
116.307084,
30.957886,
986.8
],
[
116.307854,
30.956366,
928.8
],
[
116.308814,
30.954957,
889.5
],
[
116.309435,
30.954181,
868.1
],
[
116.310097,
30.953257,
857.7
],
[
116.31108,
30.952076,
813.2
],
[
116.311728,
30.951465,
789.6
],
[
116.313083,
30.949887,
798.8
],
[
116.313972,
30.949016,
810.5
],
[
116.315299,
30.947983,
854.1
],
[
116.316659,
30.947356,
873.9
],
[
116.318362,
30.947246,
844.3
],
[
116.320311,
30.947532,
777.6
],
[
116.322161,
30.947278,
756.3
],
[
116.323894,
30.947126,
729.5
],
[
116.32554,
30.946945,
706.9
],
[
116.327018,
30.946953,
682.7
],
[
116.328438,
30.947573,
630.3
],
[
116.330172,
30.948662,
602.8
],
[
116.331907,
30.950156,
664.6
],
[
116.33243,
30.950928,
702.8
],
[
116.333102,
30.951828,
749.2
],
[
116.333675,
30.952701,
791.2
],
[
116.334272,
30.95383,
845.2
],
[
116.335195,
30.955225,
866.2
],
[
116.335692,
30.956297,
880.7
],
[
116.336091,
30.957366,
899
],
[
116.335563,
30.958738,
956
],
[
116.33534,
30.960339,
943.3
],
[
116.334768,
30.961642,
938.4
],
[
116.33397,
30.962037,
957.5
],
[
116.333001,
30.962269,
990.7
],
[
116.331772,
30.96233,
1019.4
],
[
116.330698,
30.963203,
1012.4
],
[
116.329754,
30.964424,
980.5
],
[
116.329112,
30.965237,
959.8
],
[
116.328351,
30.965764,
949.7
],
[
116.327075,
30.966221,
943.2
],
[
116.326188,
30.966429,
945.9
],
[
116.324457,
30.965352,
965.8
],
[
116.32287,
30.964339,
980.6
],
[
116.321457,
30.963487,
1003.1
],
[
116.320352,
30.962925,
1061.3
],
[
116.319341,
30.963461,
1094.4
],
[
116.319075,
30.964308,
1143.2
],
[
116.318891,
30.965982,
1217.9
],
[
116.319278,
30.96747,
1246.9
],
[
116.319679,
30.968719,
1262.8
],
[
116.321013,
30.970842,
1221.2
],
[
116.322484,
30.971797,
1220.3
],
[
116.324086,
30.972803,
1195
],
[
116.32542,
30.972965,
1162.9
],
[
116.326527,
30.972448,
1175.3
],
[
116.327719,
30.972177,
1171.5
],
[
116.328957,
30.971758,
1175.8
],
[
116.329802,
30.971099,
1190.7
],
[
116.330639,
30.97069,
1190.8
],
[
116.332212,
30.970624,
1168.3
],
[
116.33443,
30.969919,
1173.3
],
[
116.335192,
30.969353,
1194.4
],
[
116.335853,
30.968576,
1229.9
],
[
116.336809,
30.967589,
1273
],
[
116.337991,
30.967753,
1243.3
],
[
116.339343,
30.967846,
1235.7
],
[
116.340888,
30.969012,
1254.6
],
[
116.341363,
30.970081,
1309.1
],
[
116.341628,
30.971358,
1356.6
],
[
116.343458,
30.97675,
1129.5
],
[
116.343561,
30.979784,
1046.3
],
[
116.342004,
30.979498,
1086.3
],
[
116.339983,
30.977892,
1195.8
]
],
style: {
shape: "pipeline",
radius: 50,
thicknes: 10,
startAngle: 0,
endAngle: 360, // 拱形半圆管道
color: "#3388ff",
opacity: 0.6
},
attr: { remark: "示例1" }
})
graphicLayer.addGraphic(graphic) // 还可以另外一种写法: graphic.addTo(graphicLayer)
setTimeout(()=>{
alert(1)
graphic.autoSurfaceHeight({ exact: true }).then(function (e) {
graphicLayer.flyTo() // 还可以另外一种写法: graphic.addTo(graphicLayer)
})
},10000)
}
管道经过山区的时候,点位不够精细,看起来像是悬浮在空中。
开启深度监测后,管道的回显正常了,但是其他的数据被影响了
可以计算数据的准确的贴地值之后,再精细显示
功能示例(Vue版) | Mars3D三维可视化平台 | 火星科技
标签:function,graphic,点位,示例,悬浮,解决方案,管道,addTo,graphicLayer From: https://blog.csdn.net/m0_69803146/article/details/144296896