Constructor
new SingleBuildingLayer()
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
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
- Default Value:
- 'white'
触发点击事件时楼层底板的颜色
Type:
- String
floorColorOpacity :Number
- Default Value:
- 0.6
触发点击事件时楼层底板的颜色的透明度
Type:
- Number
floorLinesColor :String
- Default Value:
- '#627BC1'
建筑物楼层线颜色
Type:
- String
floorLinesOpacity :Number
- Default Value:
- 0.5
建筑物楼层线的透明度
Type:
- Number
id :String
- Default Value:
- '1'
图层id
Type:
- String
isCirclesVisible :Boolean
- Default Value:
- true
建筑物底部圆环是否可见
Type:
- Boolean
isFloorLinesVisible :Boolean
- Default Value:
- true
建筑物楼层线是否可见
Type:
- Boolean
isPillarVisible :Boolean
- Default Value:
- true
是否显示侧棱柱
Type:
- Boolean
isRoofVisible :Boolean
- Default Value:
- true
楼顶的可见性
Type:
- Boolean
lightColor :String
- Default Value:
- 'rgb(255, 255, 0)'
灯光颜色
Type:
- String
lightShown :Boolean
- Default Value:
- true
灯光效果是否开启
Type:
- Boolean
movingFloorColor :String
- Default Value:
- 'rgb(135, 135, 135)'
触发move事件时楼层底板的颜色
Type:
- String
movingFloorColorOpacity :Number
- Default Value:
- 0.2
触发move事件时楼层底板的颜色的透明度
Type:
- Number
originalFloorColor :String
- Default Value:
- '#627BC1'
楼层底板的颜色
Type:
- String
originalFloorOpacity :Number
- Default Value:
- 0.1
楼层底板的透明度
Type:
- Number
originalWallColor :String
- Default Value:
- '#627BC1'
楼层墙的颜色
Type:
- String
originalWallOpacity :Number
- Default Value:
- 0.05
楼层墙的透明度
Type:
- Number
pillarColor :String
- Default Value:
- '#ffffff'
侧棱柱的颜色
Type:
- String
pillarOpacity :Number
- Default Value:
- 0.5
侧棱柱的透明度
Type:
- Number
roofColor :String
- Default Value:
- '#627BC1'
楼顶的颜色
Type:
- String
roofOpacity :Number
- Default Value:
- 0.8
楼顶的透明度
Type:
- Number
specificFloorColor :String
- Default Value:
- '#00FFFF'
定位到指定楼层的楼层底板颜色
Type:
- String
specificFloorColorOpacity :Number
- Default Value:
- 0.6
定位到指定楼层的楼层底板的颜色的透明度
Type:
- Number
specificWallColor :String
- Default Value:
- 'rgb(32, 178, 170)'
定位到指定楼层的墙面颜色
Type:
- String
specificWallColorOpacity :Number
- Default Value:
- 0.3
定位到指定楼层的墙面颜色的透明度
Type:
- Number
topLineColor :String
- Default Value:
- '#ffffff'
建筑物顶层线颜色
Type:
- String
topLineOpacity :Number
- Default Value:
- 1.0
建筑物顶层线的透明度
Type:
- Number
visible :Boolean
- Default Value:
- true
可见性
Type:
- Boolean
wallColor :String
- Default Value:
- 'yellow'
触发点击事件时楼层墙的颜色
Type:
- String
wallColorOpacity :Number
- Default Value:
- 0.3
触发点击事件时楼层墙的颜色的透明度
Type:
- Number
Methods
addTo(three)
关联Three
Parameters:
Name | Type | Description |
---|---|---|
three |
GeoGlobe.Visuals.Three |
clear()
清空单选高亮和定位高亮
getColor(data) → {String}
- Default Value:
- data.properties.color
颜色GET属性
Parameters:
Name | Type | Description |
---|---|---|
data |
Feature | geojson中的一个Feature |
Returns:
color - 颜色值
- Type
- String
getElevation(data) → {Int}
建筑高程的GET属性
Parameters:
Name | Type | Description |
---|---|---|
data |
Feature | geojson中的一个Feature |
Returns:
elevation - 返回高程值
- Type
- Int
getPolygon(data) → {Array}
- Default Value:
- data.geometry.coordinates
多边形几何对象GET属性
Example
[[[114.27731517981033,30.597299735680195],[114.2771650822979,30.59732760632838],[114.27706858577743,30.597401572142914],[114.2771114663513,30.597447680396996],[114.27731517981033,30.597299735680195]]]
Parameters:
Name | Type | Description |
---|---|---|
data |
Feature | geojson中的一个Feature |
Returns:
coordinates - 返回组成多边形的坐标数组
- Type
- Array
getSelectedFloor(intersects) → {Object}
返回被选中楼层对象
Parameters:
Name | Type | Description |
---|---|---|
intersects |
Array | 点击交互网格集合 |
Returns:
interscet - 返回被选中楼层对象
- Type
- Object
highlightFloor(intersects) → {Object}
对选中楼层进行高亮(只高亮底板)hover事件(单选)
Parameters:
Name | Type | Description |
---|---|---|
intersects |
Array | 点击交互网格集合 |
Returns:
interscet - 返回被选中楼层对象
- Type
- Object
highlightFloor_Wall(intersects) → {Object}
对选中楼层进行高亮(包括外墙和底板)click事件(单选)
Parameters:
Name | Type | Description |
---|---|---|
intersects |
Array | 点击交互网格集合 |
Returns:
interscet - 返回被选中楼层对象
- Type
- Object
locateToSpecificFloor(level) → {Object|Array}
定位到指定楼层
Parameters:
Name | Type | Description |
---|---|---|
level |
Number | Array.<Number> | 指定楼层 |
Returns:
interscet - 返回被选中楼层对象
- Type
- Object | Array
remove()
从父对象中移除自己
render()
绘制