- 在开发广告牌的时候,有时候需要再广告牌上面添加一下自定义属性,这个时候就可以使用
properties
设置的时候
billboardCollection.entities.add({
position: Cesium.Cartesian3.fromDegrees(Lon, Lat),
name: `label${index}`,
billboard: {
image: pinBuilder.fromText(index + '', newColor, 38).toDataURL(),
pixelOffset: new Cesium.Cartesian2(0, -20)
},
properties: {
index: index,
age: age
}
})
获取里面的数据
实体.properties?.getValue(new Cesium.JulianDate())
// {index:'xxx',age:'xxx'}
参考链接
https://cesium.com/learn/cesiumjs/ref-doc/PropertyBag.html?classFilter=PropertyBag
cesium.com/learn/cesiu…