const addPoint = (cartesian) => {
pointEntitie.value = new Cesium.Entity({
id: id,
name: 'Point',
position: cartesian,
point: {
pixelSize: 10,
color: color,
disableDepthTestDistance: Number.POSITIVE_INFINITY
},
label : {
text : id,
show : true ,
font: '18px sans-serif',
fillColor: Cesium.Color.GOLD,
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
showBackground: true, //指定标签后面背景的可见性
backgroundColor: new Cesium.Color(0.165, 0.165, 0.165, 0.8), // 背景颜色
backgroundPadding: new Cesium.Cartesian2(6, 6),
outlineWidth: 2,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
pixelOffset: new Cesium.Cartesian2(-20, 20),
clampToGround: true,
disableDepthTestDistance: Number.POSITIVE_INFINITY,
}
});
viewer.entities.add(pointEntitie.value);
}
cesium 画点
于 2024-02-18 14:47:53 首次发布