SingleBuildingWidget

new Cesium.SingleBuildingWidget(options, callback_click, callback_move)

三维地图3dtiles单体化类-将矢量面拉伸为白模
Name Type Description
options Object optional 对象具有以下属性:
Name Type Default Description
viewer Viewer optional 三维球
data Object {} optional 面要素geojson对象
show Boolean true optional 是否显示单体建筑
fillColor Color Cesium.Color.CORNFLOWERBLUE.withAlpha(0.3) optional 楼层填充颜色
highlightColor_click Color Cesium.Color.YELLOW.withAlpha(0.3) optional 左键点击高亮时颜色
highlightColor_move Color Cesium.Color.DARKGREY.withAlpha(0.3) optional 鼠标移动时高亮颜色
callback_click function optional 左键点击事件回调函数
callback_move function optional 鼠标移动事件回调函数
Example:
// 初始化控件.
var SingleBuildingWidget = new Cesium.SingleBuildingWidget({
    viewer:viewer
    show: true,
    fillColor: Cesium.Color.CORNFLOWERBLUE.withAlpha(0.3),
    highlightColor_click: Cesium.Color.YELLOW.withAlpha(0.3),
    highlightColor_move: Cesium.Color.WHITE.withAlpha(0.2)
}, function(e) {}, function() {e});
SingleBuildingWidget.activate();
var data = {
    "type": "Feature",
    "geometry": {
        "type": "Polygon",
        "coordinates": [[
            [108.9592500,34.2199251],[108.9596171,34.2199291],[108.9596171,34.2196485],[108.9592500,34.2196485],[108.9592500,34.2199251]
        ]]
    },
    "properties": {
        "id": 100001,
        "level": 8,
        "name": "大雁塔",
        "levels": [9,6,8,7,7,7,6],
        "baseHeight": 428.089  //设置该属性会是更好的选择,可使楼层高度更准确
    }
};
singleBuildingWidget.data = data;  //添加数据
singleBuildingWidget.extrudeToBuilding();  //拉伸建筑
Demo:

Members

data : Object

geojson面数据
Default Value: {}

show : Boolean

是否显示

Methods

activate()

激活动作

clear()

清除primitive绘制痕迹

deActivate()

关闭动作

destroy()

销毁

extrudeToBuilding()

拉伸矢量面为白模(贴模型)

highlightFloor(level)Primitive

高亮当前单体建筑的指定楼层
Name Type Description
level Number optional 楼层层数
Returns:
楼层几何对象