ViewerGIS

Glodon.Bimface.Viewer~ ViewerGIS

Glodon.Bimface.Viewer.ViewerGIS

Constructor

new Glodon.Bimface.Viewer.ViewerGIS(option)

Parameters:
Name Type Description
option Glodon.Bimface.Viewer.ViewerGISConfig

配置

Methods

addScene(场景的ViewToken)

加载场景

Parameters:
Name Type Description
场景的ViewToken String

clearIsolation()

清除隔离

cloneModel(sourceModelId, destModelId)

克隆模型,克隆模型将自动添加到源模型相同位置

Parameters:
Name Type Description
sourceModelId String

源模型ID

destModelId String

克隆模型ID

createSnapshot(callback)

创建快照

Parameters:
Name Type Description
callback function

快照回调函数

enableDamping(enable)

是否开启阻尼效果

Parameters:
Name Type Description
enable boolean

是否开启模型平移、缩放、旋转的阻尼效果

enableFullScreen(isEnabled)

设置是否开启全屏模式

Parameters:
Name Type Description
isEnabled Boolean

是否开启全屏模式

enableMouseMovePick(enable)

设置鼠标滑动拾取坐标

Parameters:
Name Type Description
enable Boolean

开启或关闭鼠标滑动拾取坐标

getBackgroundColors()

获取场景背景颜色信息

Returns:
Type Description
Object

背景颜色信息

getBasePoint()

获取基准坐标点

Returns:
Type Description
Object

基准坐标点信息

getCameraStatus()

获取当前相机位置信息,用于保存后恢复相机视点

Returns:
Type Description
Object

相机位置信息

getHomeView()

获取Home视图

Returns:
Type Description
Object

Home视图

getLayerManager()

获取图层管理器

Returns:
Type Description
Object

图层管理器

getLightingMode()

获取当前光照模式

Returns:
Type Description
String

光照模式:‘IBL’,基于图像模式;‘Phong’普通模式

hideNorthArrow()

隐藏指北针

isolateLayerByIds(ids, state)

对指定图层进行隔离,对BIMLayer, FeatureLayer生效

Parameters:
Name Type Description
ids Array

由图层ID组成的数组

state Glodon.Bimface.Viewer.IsolateOption

被隔离构件显示状态,如Glodon.Bimface.Viewer.IsolateOption.MakeOthersTranslucent

latLonToWorld(option)

根据经纬度获取世界坐标

Parameters:
Name Type Description
option Object

配置选项

Properties
Name Type Description
latLon Object

经纬度,例{lat:31.5643,lon:123.2546}

layerId String

图层id

render()

模型渲染,当修改了模型构件的状态,必须手动调用render(),场景才会显示效果,如果同时需要调用多个函数,强烈建议在最后调用一次render()

sceneToWorld(scenePoint)

场景坐标转世界坐标

Parameters:
Name Type Description
scenePoint Object

场景坐标系下的点 {x:0, y:0, z:0}

Returns:
Type Description
Object

世界坐标系下的点 {x:0, y:0, z:0}

setBackgroundColors(option)

设置场景背景颜色

Parameters:
Name Type Description
option Object

场景背景色信息

Properties
Name Type Description
direction Number

渐变方向,弧度制。可填0:由下至上渐变;Math.PI/2:由左至右渐变;Math.PI:由上至下渐变;3Math.PI/2:由右至左渐变。默认为Math.PI。

colors Array

由颜色与颜色位置组成的对象构成的数组。默认为:[{"color":new Glodon.Web.Graphics.Color(88,103,133,1),"stop":"0%"},{"color":new Glodon.Web.Graphics.Color(229,234,242,1),"stop":“100%”}]

setCameraMinimumElevation(elevation)

限制相机的最小高度

Parameters:
Name Type Description
elevation Number

最小高度,单位为米,参数为空时,不限制相机高度

setCameraStatus(camera, callback)

根据相机位置信息恢复视点

Parameters:
Name Type Description
camera Object

相机状态,getCameraStatus()返回的对象

callback function

相机还原之后回调函数,可不写

setDampingFactor(factor)

设置阻尼效果参数

Parameters:
Name Type Description
factor number

阻尼效果参数,取值范围[1,10],数值越大,阻尼效果越明显。默认值10。

setExposureCompensation(compensation)

设置场景曝光补偿,补偿量范围为[-1, 1],默认为0,正值代表增加曝光,负值代表减少曝光

Parameters:
Name Type Description
compensation Number

场景曝光补偿量,取值范围为[-1, 1]

setHomeView()

设置Home视图

showNorthArrow()

显示指北针

startAutoRotate(speed, point)

开始自动旋转模型

Parameters:
Name Type Description
speed Number

速率,正负表示方向,数值表示速度

point Object

旋转中心,{x:,y:,z:},缺省为场景中心

stopAutoRotate()

停止自动旋转模型

worldToScene(worldPoint)

世界坐标转场景坐标

Parameters:
Name Type Description
worldPoint Object

世界坐标系下的点 {x:0, y:0, z:0}

Returns:
Type Description
Object

场景坐标系下的点 {x:0, y:0, z:0}

zoomIn()

模型放大

zoomOut()

模型缩小

zoomToBoundingBox(options, callback)

缩放到指定的BoundingBox

Parameters:
Name Type Description
options Object

options.boundingBox 获取的构件的BoundingBox options.margin Number 包围盒缩放比例, 默认值为0.5, margin > 0 模型缩小(包围盒变大),margin < 0 模型放大(包围盒变小) options.duration Number 动画持续时间,单位为毫秒, 默认值为1000

callback function

缩放完成时的回调函数,可不写