geosolution/scene~CityBuildingLayer(name, options)

城市建筑图层,通过添加白模Stretchmodule:model~Stretch,模拟城市中的建筑物。统一设置建筑物的屋顶颜色、墙体颜色、窗户颜色、房屋亮灯时窗户颜色、亮灯比例等。

Summary

Methods:
addFeature

添加指定的feature。

removeFeature

删除已添加到图层中的指定的feature。

updateFeature

更新已添加到图层中的指定的feature。

Constructor

new CityBuildingLayer(name, options)

Parameters:
Name Type Description
name String

图层名称

options Object

可选项。给出的属性都将被绑定到该图层对象上。可以通过修改该图层对象的窗户尺寸、颜色、亮灯比例等属性,改变建筑样式,调用该图层重绘方法生效,

Name Type Description
windowSize Array.<Number>

窗户尺寸大小,单位为米,数组的第一个元素是窗户的宽度,第二个元素是窗户的高度,默认值为[4, 3]。

wallColor module:style~Color

建筑墙体的颜色,默认值rgba(47, 21, 84, 1)。

roofColor module:style~Color

建筑房顶的颜色,默认值RGB各分量分别为墙体颜色的1.5倍。

windowColor module:style~Color

建筑窗户的颜色,默认值rgba(32, 12, 64, 1)。

brightWindowColor module:style~Color

房间亮灯时,建筑窗户的颜色,默认值rgba(135, 166, 210, 1)。

brightRatio String

亮灯房间占所有房间的比例,值可以为'no'、'rarely'、'less'、'medium'、'much'、'almost'、'all'中的一个,亮灯比例将从无到全部变化。默认'medium'。

Members

clampToGround

设置贴地状态

Overrides:

depthTest

获取图层的深度测试属性
return {Boolean} 深度测试属性

Overrides:

Methods

addFeature(feature)

添加指定的feature。

Parameters:
Name Type Description
feature module:model~Stretch

待添加的白模

removeFeature(feature)

删除已添加到图层中的指定的feature。

Parameters:
Name Type Description
feature module:model~Stretch

需要删除的白模

updateFeature(feature)

更新已添加到图层中的指定的feature。

Parameters:
Name Type Description
feature module:model~Stretch

需要更新的白模