1.添加点
let point = this.viewer.entities.add({
name: 'templatePoint',
id: '00000002592c00ff00000003',
position: Cesium.Cartesian3.fromDegrees(120.3399661750176, 36.1697814797149),
point: {
color: Cesium.Color.RED,
pixelSize: 16,
disableDepthTestDistance: 50000
},
label: {
text: '点1',
fillColor: Cesium.Color.YELLOW,
outlineColor: Cesium.Color.YELLOW,
pixelOffset: new Cesium.Cartesian2(0.0, -30)
}
})
2.存储点
this.eventPoints.push(point)
3.删除点
if (this.eventPoints.length) {
this.eventPoints.forEach(item => {
this.viewer.entities.remove(item)
})
this.eventPoints = []
}