Constructor
new Glodon.Bimface.Layer.LayerManager(viewer)
Parameters:
Name | Type | Description |
---|---|---|
viewer | Glodon.Bimface.Viewer.ViewerGIS | ViewerGIS对象 |
Methods
addLayer(layer, parentId)
添加一个图层
Parameters:
Name | Type | Description |
---|---|---|
layer | Object | 新构造的图层对象,支持GroupLayer、TileLayer、BIMLayer、ExternalObjectLayer等格式 |
parentId | String | 新图层的父图层ID(父图层需为GroupLayer),不填则默认父图层为RootLayer |
buildLayers(layerConfigsObject)
通过传入的图层配置信息,加载各图层
Parameters:
Name | Type | Description |
---|---|---|
layerConfigsObject | Object | 图层配置信息 |
buildLayers(layerConfigsObject)
通过传入的图层配置信息,加载各图层
Parameters:
Name | Type | Description |
---|---|---|
layerConfigsObject | Object | 图层配置信息 |
getLayer(layerId)
根据图层ID获取对应图层
Parameters:
Name | Type | Description |
---|---|---|
layerId | String | 图层ID |
Returns:
Type | Description |
---|---|
Object |
图层对象 |
getLayerByType(layerId)
根据图层Type获取对应图层
Parameters:
Name | Type | Description |
---|---|---|
layerId | String | 图层类型 |
Returns:
Type | Description |
---|---|
Array |
图层对象列表 |
getLayerConfigsObject()
获得当前已加载各图层的配置信息
Returns:
Type | Description |
---|---|
Object |
图层配置信息 |
getLayerPriority(layerId)
获取指定图层的加载优先级
Parameters:
Name | Type | Description |
---|---|---|
layerId | String | 待设置的图层ID |
Returns:
Type | Description |
---|---|
Number |
加载优先级 |
getRootLayer()
获取根图层
Returns:
Type | Description |
---|---|
Glodon.Bimface.Layer.GroupLayer |
根图层对象 |
moveLayer(layerId, targetLayerId)
移动一个图层
Parameters:
Name | Type | Description |
---|---|---|
layerId | String | 待移动的图层ID |
targetLayerId | String | 待移动图层的新父图层ID(父图层需为GroupLayer) |
removeLayer(layerId)
删除一个图层
Parameters:
Name | Type | Description |
---|---|---|
layerId | String | 待删除的图层ID |
setLayerPriority(layerId, priority)
设置指定图层的加载优先级,对BIMLayer和FeatureLayer生效,影响初始加载顺序
Parameters:
Name | Type | Description |
---|---|---|
layerId | String | 待设置的图层ID |
priority | Number | 待设置的加载优先级,取值为1以上的整数,BIMLayer和FeatureLayer的加载优先级默认值为3 |
showLayers(layerIds)
多个隐藏的图层批量设置为显示,对初始未加载的隐藏图层做排序
Parameters:
Name | Type | Description |
---|---|---|
layerIds | Array | 图层ID列表 |
zoomToLayer(layerId, callback)
缩放至图层
Parameters:
Name | Type | Description |
---|---|---|
layerId | String | 图层ID |
callback | function | 缩放结束后的回调事件,可不填 |