WaterReflecter

new Cesium.WaterReflecter(scene, options)

倒影水
Name Type Description
scene Scene viewer中的scene对象
options Object optional 对象具有如下属性:
Name Type Description
positions Array optional 水面的边界坐标(经纬度)集合,单位为度.其与options.polygonHierarchy选项互斥.
polygonHierarchy PolygonHierarchy optional 其与options.positions选项互斥.边界范围,PolygonHierarchy可含洞或者岛
id String optional 对象的id
height Number optional 水面的高度,默认值为0
reflectHeight Number optional 反射面高程,默认值为0.0
uniformEelevation Number optional 是否将水面置为统一平面,如果是则水面的边界点高程值为height,否则在原有高程基础上增加height高度,默认值为false
waterColor Color optional 水面颜色,其透明度决定了水面的透明度,默认值为Color(0.0,0.0,0.0,0.8)
reflectBlendColor Color optional 倒影融合颜色,默认值为Color(1.0, 1.0, 1.0, 1.0)
Examples:
const water = new Cesium.WaterReflecter(viewer.scene, {
 positions:[116.9648,33.658527,116.9678990,33.6585,116.968,33.66125,116.9645,33.6612,],
 height:30.0
});
viewer.scene.addReflectWater(water);
const loadPromise = Cesium.GeoJsonDataSource.load('data/vector/polygon/suzhouwater0807/layer.json');
loadPromise.then(function(dataSource) {
  const entities = dataSource.entities.values;
    for (let i = 0; i < entities.length; i++) {
      let entity = entities[i];
      let options = {
        polygonHierarchy:entity.polygon._hierarchy._value,
        height:30,
      };
      const water = new Cesium.WaterReflecter(viewer.scene,wtateoption);
      viewer.scene.addReflectWater(water);
   }
})

Members

获取对象的id
设置/获取水面倒影的融合颜色
设置/获取对象是否显示
设置/获取水面的颜色
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.