Cesium例子: https://sandcastle.cesium.com/index.html?src=3D%20Models.html&label=All
颜色
// 颜色自定义
var xColors = new Cesium.Color(0.09412, 0.09804, 0.18431, 0.5); //深蓝
var xColors2 = new Cesium.Color(1, 1, 1, 0.8); //白色
var color = Cesium.Color.RED; //红色
点
//经纬度
var longitude = 118;
var latitude = 30;
// 点
viewer.entities.add({
id:'点',
name:'蓝点',
show: true, //显示.
position: Cesium.Cartesian3.fromDegrees(longitude, latitude, 0.0),
point: {
color: Cesium.Color.BLUE, //颜色
pixelSize: 5,//点大小
}
});
线
let longitude1 = 119;
let latitude1 = 32;
// 线
var linePoint = [longitude, latitude, longitude1, latitude1];
viewer.entities.add({
id: 'line',
show: true, //显示
polyline: {
positions: Cesium.Cartesian3.fromDegreesArray(linePoint),
width: 1, //线条粗细
followSurface: false, //取消弯曲
material: Cesium.Color.YELLOW, //线条材质
clampToGround: true
},
label: {
text: '超完美线条', //文本
show: true, // 默认显示
font: '12pt Source Han Sans CN', //字体样式
fillColor: xColors , //字体颜色
backgroundColor