本文主要是介绍cesium-点线面,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
let viewer = new Cesium.Viewer('cesiumContainer');//平面let plane = viewer.entities.add({name: '带边框的平面',position: Cesium.Cartesian3.fromDegrees(-107.0, 40.0, 300000.0),//经纬度转世界坐标plane: {show: true,//是否显示plane: new Cesium.Plane(Cesium.Cartesian3.UNIT_Z, 0.0), //朝向屏幕dimensions: new Cesium.Cartesian2(400000.0, 300000.0), //二维平面material: Cesium.Color.BLUE,//材质fill: true,//填充outline: true,//显示边框outlineColor: Cesium.Color.YELLOW,//边框颜色}});//点let point = viewer.entities.add({name: '点',position: Cesium.Cartesian3.fromDegrees(-75.0, 30.0),//经纬度转世界坐标point: {show: true,color: Cesium.Color.GREEN,pixelSize: 20,outlineColor: Cesium.Color.YELLOW,outlineWidth: 3,}});//线let line = viewer.entities.add({name: '线',polyline: {positions: Cesium.Cartesian3.fromDegreesArray([-75, 30, -125, 30]),//经纬度数组转世界坐标,带高度的话是fromDegreesArrayHeightswidth: 5,material: Cesium.Color.CYAN}});//面let polygon = viewer.entities.add({name: '面',polygon: {hierarchy: {//层次positions: Cesium.Cartesian3.fromDegreesArray([-99.0,30.0,-85.0,30.0,-85.0,40.0,-99.0,40.0,]),holes: [{ //挖洞,可以无限嵌套positions: Cesium.Cartesian3.fromDegreesArray([-97.0,31.0,-97.0,39.0,-87.0,39.0,-87.0,31.0,]),holes: [ {positions: Cesium.Cartesian3.fromDegreesArray([-95.0,33.0,-89.0,33.0,-89.0,37.0,-95.0,37.0,])}]}],},material: Cesium.Color.RED.withAlpha(0.5)}});
这篇关于cesium-点线面的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!