new SingleBuildingLayer()
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
Example
//构造地图对象 var map = new GeoGlobe.Map({ style: Cfg.style, container: 'map', zoom: 16, bearing: -47, pitch: 45, units: "degrees", center: [114.26734490525155, 30.594607628267966] }); //构造THREE可视化图层 var threebox = new GeoGlobe.Visuals.Three(); //添加到地图中 threebox.addTo(map); //构造线图层 var SingleBuildingLayer = new GeoGlobe.Visuals.Three.SingleBuildingLayer({ id: 'single building', data: [], visible: true, isCirclesVisible: false, isFloorLinesVisible: true, lightShown: false, lightColor: 'rgb(255, 255, 0)', floorColor: 'white', floorColorOpacity: 0.6, wallColor : 'yellow', wallColorOpacity: 0.3, movingFloorColor: 'rgb(135, 135, 135)', movingFloorColorOpacity: 0.2 }); //添加到THREE图层 SingleBuildingLayer.addTo(threebox); //绘制 threebox.render();
Members
-
data :Object
-
面要素数据
Type:
- Object
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
Example
{ "type":"Feature", "properties":{ "id": 100001, "level":7, "name":"中国银行(武汉新台北支行)", "levels": [3,3,4,5,3,3,3] }, "geometry":{ "type":"Polygon", "coordinates":[[[114.27731517981033,30.597299735680195],[114.2771650822979,30.59732760632838],[114.27706858577743,30.597401572142914],[114.2771114663513,30.597447680396996],[114.27731517981033,30.597299735680195]]] } }
-
floorColor :String
-
触发点击事件时楼层底板的颜色
Type:
- String
- Default Value:
-
- 'white'
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
floorColorOpacity :Number
-
触发点击事件时楼层底板的颜色的透明度
Type:
- Number
- Default Value:
-
- 0.6
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
floorLinesColor :String
-
建筑物楼层线颜色
Type:
- String
- Default Value:
-
- '#627BC1'
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
floorLinesOpacity :Number
-
建筑物楼层线的透明度
Type:
- Number
- Default Value:
-
- 0.5
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
id :String
-
图层id
Type:
- String
- Default Value:
-
- '1'
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
isCirclesVisible :Boolean
-
建筑物底部圆环是否可见
Type:
- Boolean
- Default Value:
-
- true
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
isFloorLinesVisible :Boolean
-
建筑物楼层线是否可见
Type:
- Boolean
- Default Value:
-
- true
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
isPillarVisible :Boolean
-
是否显示侧棱柱
Type:
- Boolean
- Default Value:
-
- true
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
isRoofVisible :Boolean
-
是否显示楼顶
Type:
- Boolean
- Default Value:
-
- true
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
lightColor :String
-
灯光颜色
Type:
- String
- Default Value:
-
- 'rgb(255, 255, 0)'
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
lightShown :Boolean
-
灯光效果是否开启
Type:
- Boolean
- Default Value:
-
- true
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
movingFloorColor :String
-
触发move事件时楼层底板的颜色
Type:
- String
- Default Value:
-
- 'rgb(135, 135, 135)'
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
movingFloorColorOpacity :Number
-
触发move事件时楼层底板的颜色的透明度
Type:
- Number
- Default Value:
-
- 0.2
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
originalFloorColor :String
-
楼层底板的颜色
Type:
- String
- Default Value:
-
- '#627BC1'
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
originalFloorOpacity :Number
-
楼层底板的透明度
Type:
- Number
- Default Value:
-
- 0.1
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
originalWallColor :String
-
楼层墙的颜色
Type:
- String
- Default Value:
-
- '#627BC1'
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
originalWallOpacity :Number
-
楼层墙的透明度
Type:
- Number
- Default Value:
-
- 0.05
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
pillarColor :String
-
侧棱柱的颜色
Type:
- String
- Default Value:
-
- '#ffffff'
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
pillarOpacity :Number
-
侧棱柱的透明度
Type:
- Number
- Default Value:
-
- 0.5
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
roofColor :String
-
楼顶的颜色
Type:
- String
- Default Value:
-
- '#627BC1'
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
roofOpacity :Number
-
楼顶的透明度
Type:
- Number
- Default Value:
-
- 0.8
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
specificFloorColor :String
-
定位到指定楼层的楼层底板颜色
Type:
- String
- Default Value:
-
- '#00FFFF'
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
specificFloorColorOpacity :Number
-
定位到指定楼层的楼层底板的颜色的透明度
Type:
- Number
- Default Value:
-
- 0.6
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
specificWallColor :String
-
定位到指定楼层的墙面颜色
Type:
- String
- Default Value:
-
- 'rgb(32, 178, 170)'
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
specificWallColorOpacity :Number
-
定位到指定楼层的墙面颜色的透明度
Type:
- Number
- Default Value:
-
- 0.3
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
topLineColor :String
-
建筑物顶层线颜色
Type:
- String
- Default Value:
-
- '#ffffff'
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
topLineOpacity :Number
-
建筑物顶层线的透明度
Type:
- Number
- Default Value:
-
- 1.0
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
visible :Boolean
-
可见性
Type:
- Boolean
- Default Value:
-
- true
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
wallColor :String
-
触发点击事件时楼层墙的颜色
Type:
- String
- Default Value:
-
- 'yellow'
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
wallColorOpacity :Number
-
触发点击事件时楼层墙的颜色的透明度
Type:
- Number
- Default Value:
-
- 0.3
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
Methods
-
addTo(three)
-
关联Three
Parameters:
Name Type Description three
GeoGlobe.Visuals.Three - Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
getColor(data)
-
颜色GET属性
Parameters:
Name Type Description data
Feature geojson中的一个Feature - Default Value:
-
- data.properties.color
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
Returns:
color - 颜色值- Type
- String
-
getElevation(data)
-
建筑高程的GET属性
Parameters:
Name Type Description data
Feature geojson中的一个Feature - Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
Returns:
elevation - 返回高程值- Type
- Int
-
getPolygon(data)
-
多边形几何对象GET属性
Parameters:
Name Type Description data
Feature geojson中的一个Feature - Default Value:
-
- data.geometry.coordinates
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
Returns:
coordinates - 返回组成多边形的坐标数组- Type
- Array
Example
[[[114.27731517981033,30.597299735680195],[114.2771650822979,30.59732760632838],[114.27706858577743,30.597401572142914],[114.2771114663513,30.597447680396996],[114.27731517981033,30.597299735680195]]]
-
getSelectedFloor( [Array])
-
返回被选中楼层对象
Parameters:
Name Type Argument Description Array
<optional>
intersects - 点击交互网格集合 - Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
Returns:
interscet - 返回被选中楼层对象- Type
- Object
-
highlightFloor( [Array])
-
对选中楼层进行高亮(只高亮底板)
Parameters:
Name Type Argument Description Array
<optional>
intersects - 点击交互网格集合 - Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
Returns:
interscet - 返回被选中楼层对象- Type
- Object
-
highlightFloor_Wall( [Array])
-
对选中楼层进行高亮(包括外墙和底板)
Parameters:
Name Type Argument Description Array
<optional>
intersects - 点击交互网格集合 - Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
Returns:
interscet - 返回被选中楼层对象- Type
- Object
-
locateToSpecificFloor(Number)
-
定位到指定楼层
Parameters:
Name Type Description Number
level - 指定楼层 - Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
Returns:
interscet - 返回被选中楼层对象- Type
- Object
-
remove()
-
从父对象中移除自己
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js
-
render()
-
绘制
- Source:
- View2D/Visuals/Three/SingleBuildingLayer.js