ViewerGIS
类:操作GIS场景的类
Constructor
new Glodon.Bimface.Earth.Viewer.ViewerGIS(viewerGISConfig)
Parameters:
| Name | Type | Description | 
|---|---|---|
| viewerGISConfig | Glodon.Bimface.Earth.Viewer.ViewerGISConfig | viewerGIS的配置项 | 
Methods
addEventListener(event, callback)
注册监听事件
Parameters:
| Name | Type | Description | 
|---|---|---|
| event | Glodon.Bimface.Earth.Viewer.ViewerGISEvent | 监听事件 | 
| callback | Function | 监听事件的回调函数 | 
addScene(viewToken)
加载场景
Parameters:
| Name | Type | Description | 
|---|---|---|
| viewToken | String | 场景的viewToken | 
createSnapshotAsync(callback)
创建场景快照
Parameters:
| Name | Type | Description | 
|---|---|---|
| callback | Function | 快照回调函数 | 
destroy()
销毁场景
enableAtmosphere(isEnabled)
设置是否开启大气效果
Parameters:
| Name | Type | Description | 
|---|---|---|
| isEnabled | Boolean | 是否开启大气效果 | 
enableFullScreen(isEnabled)
设置是否开启全屏模式
Parameters:
| Name | Type | Description | 
|---|---|---|
| isEnabled | Boolean | 是否开启全屏模式 | 
enableGlowEffect(isEnabled)
是否开启发光效果
Parameters:
| Name | Type | Description | 
|---|---|---|
| isEnabled | Boolean | 是否开启发光效果,true为开启,false为关闭 | 
enableMouseMovePick(isEnabled)
设置鼠标滑动拾取坐标
Parameters:
| Name | Type | Description | 
|---|---|---|
| isEnabled | Boolean | 开启或关闭鼠标滑动拾取坐标 | 
enableSnap(isEnabled)
开启/关闭捕捉模式
Parameters:
| Name | Type | Description | 
|---|---|---|
| isEnabled | Boolean | 开启或关闭对象捕捉 | 
enableSSAOEffect(isEnabled)
是否开启SSAO效果
Parameters:
| Name | Type | Description | 
|---|---|---|
| isEnabled | Boolean | 是否开启SSAO效果,true为开启,false为关闭 | 
enableWireframe(isEnabled)
是否开启构件线框
Parameters:
| Name | Type | Description | 
|---|---|---|
| isEnabled | Boolean | 是否开启构件线框,默认为true | 
getBackgroundColors()
获取场景背景颜色信息
Returns:
| Type | Description | 
|---|---|
| Object | 背景颜色信息 | 
getBasePoint()
获取基准坐标点的经纬度
Returns:
| Type | Description | 
|---|---|
| Object | 基准坐标点信息 | 
getCamera()
获取相机对象
Returns:
| Type | Description | 
|---|---|
| Glodon.Bimface.Earth.Camera.CameraGIS | GIS场景的相机对象 | 
getLayerManager()
获取图层管理器
Returns:
| Type | Description | 
|---|---|
| Object | 图层管理器 | 
getLocationByClient(client)
基于client坐标获取位置信息
Parameters:
| Name | Type | Description | 
|---|---|---|
| client | Object | client坐标,例{x: 100,y: 100} | 
Returns:
| Type | Description | 
|---|---|
| Object | 位置坐标信息,由经纬度+高程组成,例{lat:23.123456, lon:121.123456, alt:10.123} | 
getRoomManager()
获取房间管理器对象。
Returns:
| Type | Description | 
|---|---|
| Glodon.Bimface.Earth.Plugins.Rooms.RoomManager | 房间管理器 | 
getSelectedElements()
获取所有选中的构件
Returns:
| Type | Description | 
|---|---|
| Array | 数组;数组元素是对象 | 
hideNorthArrow()
隐藏指北针
isAtmosphereEnabled()
获取当前大气效果的开启状态
Returns:
| Type | Description | 
|---|---|
| Boolean | 大气效果的开启状态 | 
isWireframeEnabled()
是否开启了构件线框
Returns:
| Type | Description | 
|---|---|
| Boolean | 是否开启了构件线框 | 
LLAToLocal(localOrigin, location)
经纬度坐标换算至局部世界坐标
Parameters:
| Name | Type | Description | 
|---|---|---|
| localOrigin | Object | 局部坐标系原点对应的经纬度坐标,例{lat:21.12345, lon:121.9876, alt:0} | 
| location | Object | 待换算的经纬度坐标,例{lat:20.9876, lon:122.0123, alt:0} | 
Returns:
| Type | Description | 
|---|---|
| Object | Null | 返回经纬度对应的局部坐标系下的世界坐标 | 
localToLLA(localOrigin, worldPosition)
局部世界坐标换算至经纬度坐标
Parameters:
| Name | Type | Description | 
|---|---|---|
| localOrigin | Object | 局部坐标系原点对应的经纬度坐标,例{lat:21.12345, lon:121.56456, alt:0} | 
| worldPosition | Object | 待换算的局部世界坐标点,例{x:123, y:123, z:5} | 
Returns:
| Type | Description | 
|---|---|
| Object | Null | 返回局部世界坐标对应的经纬度坐标 | 
removeEventListener(event, callback)
注销监听事件
Parameters:
| Name | Type | Description | 
|---|---|---|
| event | Glodon.Bimface.Earth.Viewer.ViewerGISEvent | 监听事件 | 
| callback | Function | 监听事件的回调函数 | 
render()
模型渲染,当修改了模型构件的状态,必须手动调用render(),场景才会显示效果,如果同时需要调用多个函数,强烈建议在最后调用一次render()
setBackgroundColors(option)
设置场景背景颜色
Parameters:
| Name | Type | Description | 
|---|---|---|
| option | Object | 场景背景色信息 | 
setOrbitButton(orbitButton)
设置鼠标旋转习惯(左键旋转/右键旋转)
Parameters:
| Name | Type | Description | 
|---|---|---|
| orbitButton | Glodon.Bimface.Earth.Viewer.OrbitButton | 设置鼠标旋转交互按键 | 
setSnapMode(snapMode)
设置对象捕捉模式
Parameters:
| Name | Type | Description | 
|---|---|---|
| snapMode | Glodon.Bimface.Earth.Viewer.SnapMode | 捕捉模式 | 
showNorthArrow()
显示指北针