cesium更改entity颜色

更改entity颜色

1
2
3
4
5
6
7
8
$.each(china_map_entities._children,function(i,obj){          
if(viewer.entities.getById(obj.id).polygon){
viewer.entities.getById(obj.id).polygon.material=Cesium.Color.GREEN.withAlpha(0.3)
}
if(viewer.entities.getById(obj.id).polyline){
viewer.entities.getById(obj.id).polyline.material=Cesium.Color.WHITE.withAlpha(0.1)
}
})

参考博客