Class: InstanceLayer

Glodon.CIMCube.Layer. InstanceLayer

InstanceLayer图层

new InstanceLayer(options)

InstanceLayer图层构造函数
Parameters:
Name Type Description
options Object 图层配置参数
Properties
Name Type Argument Default Description
show Boolean <optional>
true 是否显示
origin Boolean <optional>
[116.41667,39.91667,500.0] 显示entity对象
phongLighting Boolean <optional>
false 是否使用一般的光照模型(冯氏光照)
bfLighting Boolean <optional>
false 是否启用 BF 光照
cLighting Boolean <optional>
false 是否启用 C 光照
bfReflectEffect Boolean <optional>
false 是否启用 BF 反射效果
isBim Boolean <optional>
false 是否按 BIM 模型渲染
useDefaultMetallicRoughness Boolean <optional>
true 是否使用默认的金属度粗糙度,默认为true
doubleSided Boolean <optional>
图层是否使用双面材质, 会覆盖图层内部材质的双面属性, 该值默认为undefined

Extends

Members


alpha :Number

图层透明度 0.0~1.0
Type:
  • Number
Inherited From:
Overrides:
Default Value:
  • 1.0

bfLighting :Boolean

是否启用 BF 光照
Type:
  • Boolean

bfReflectEffect :Boolean

是否启用 BF 反射效果
Type:
  • Boolean

boundingSphere :BoundingSphere

图层包围球
Type:
  • BoundingSphere

cLighting :Boolean

是否启用 C 光照
Type:
  • Boolean

cacheable :Boolean

是否可缓存
Type:
  • Boolean
Inherited From:
Overrides:

canHighlight :Boolean

可否高亮
Type:
  • Boolean
Inherited From:
Overrides:

canSelected :Boolean

可否被选中
Type:
  • Boolean
Inherited From:
Overrides:

doubleSided :Boolean

图层是否使用双面材质
Type:
  • Boolean

enableMouseMove :Boolean

是否可以触发鼠标移动事件
Type:
  • Boolean
Inherited From:
Overrides:
Default Value:
  • true

enableRealisticRendering :Boolean

图层是否使用真实渲染
Type:
  • Boolean

glowColor :String

发光颜色
Type:
  • String
Inherited From:
Overrides:

glowTimeInterval :number

闪烁的时间间隔
Type:
  • number
Inherited From:
Overrides:

hiddenInLayerTree :Boolean

是否对图层树接口隐藏
Type:
  • Boolean
Inherited From:
Overrides:

<readonly> id :String

id
Type:
  • String
Inherited From:
Overrides:

isBim :Boolean

是否按 BIM 模型渲染
Type:
  • Boolean

isInstanceLayer :Boolean

标识当前图层为实例化图层
Type:
  • Boolean

isPipeline :Boolean

数据是否是管线类型
Type:
  • Boolean
Inherited From:
Overrides:

matrix :Object

图层偏移
Type:
  • Object
Inherited From:
Overrides:

name :String

图层名称
Type:
  • String
Inherited From:
Overrides:

origin :Array

图层原点,数组中分别指定经度、纬度、高度
Type:
  • Array

phongLighting :Boolean

图层是否使用一般的光照模型(冯氏光照)
Type:
  • Boolean

pickable :Boolean

pickable
Type:
  • Boolean
Inherited From:
Overrides:

<readonly> ready :Boolean

数据是否已经加载
Type:
  • Boolean
Inherited From:
Overrides:

rotationPointOffset :Cartesian3

图层指定的旋转点,模型坐标系下基于原点的偏移点,默认是包围盒中心点
Type:
  • Cartesian3
Inherited From:
Overrides:

selectedColor :String

选中颜色
Type:
  • String
Inherited From:
Overrides:

show :Boolean

图层是否显示
Type:
  • Boolean
Overrides:

<readonly> type :String

图层类型
Type:
  • String
Inherited From:
Overrides:

<readonly> url :String

图层url地址
Type:
  • String
Inherited From:
Overrides:

useDefaultMetallicRoughness :Boolean

是否使用默认的金属度粗糙度
Type:
  • Boolean

Methods


addDragHandle( [options])

在场景中添加操作句柄
Parameters:
Name Type Argument Description
options Object <optional>
配置参数
Properties
Name Type Argument Default Description
dragModelTipUI DragModelTipUI <optional>
自定义的tip ui实例
tips String <optional>
'单击鼠标左键选择需要操作的模型' 提示字符
showTips Boolean <optional>
true 是否显示提示字符
dragModelUI DragModelUI <optional>
自定义的模型实例
enableTranslationX Boolean <optional>
true X轴平移
enableTranslationY Boolean <optional>
true Y轴平移
enableTranslationZ Boolean <optional>
true Z轴平移
enableTranslationXY Boolean <optional>
true XOY面平移
enableTranslationYZ Boolean <optional>
true YOZ面平移
enableTranslationXZ Boolean <optional>
true XOZ面平移
enableRotationX Boolean <optional>
true X轴旋转
enableRotationY Boolean <optional>
true Y轴旋转
enableRotationZ Boolean <optional>
true Z轴旋转
enableScaleX Boolean <optional>
false X缩放
enableScaleY Boolean <optional>
false Y缩放
enableScaleZ Boolean <optional>
false Z缩放
targetScaleRange Array.<Number> <optional>
默认 [0.1, +infinity]
axisTranslationYColor String <optional>
"red" axisTranslationYColor
axisTranslationXColor String <optional>
"green" axisTranslationXColor
axisTranslationZColor String <optional>
"blue" axisTranslationZColor
axisTranslationXYColor String <optional>
"red" axisTranslationXYColor
axisTranslationYZColor String <optional>
"green" axisTranslationYZColor
axisTranslationXZColor String <optional>
"blue" axisTranslationXZColor
axisRotationXColor String <optional>
"red" axisRotationXColor
axisRotationYColor String <optional>
"green" axisRotationYColor
axisRotationZColor String <optional>
"blue" axisRotationZColor
axisScaleXColor String <optional>
"red" axisScaleXColor
axisScaleYColor String <optional>
"green" axisScaleYColor
axisScaleZColor String <optional>
"blue" axisScaleZColor
continueEdit Boolean <optional>
false 是否持续编辑,即点击下个对象将会让组件转移到其上
UIScaling Number <optional>
1.0 缩放UI的系数,engine会忽略小于等于0的数字
noUI Boolean <optional>
false 是否不创建UI
instanceId Number | String 指定InstanceLayer的instanceId
Overrides:
  • Glodon.CIMCube.Layer.BaseLayer#addDragHandle
Returns:
拖拽句柄
Type
Object

addModel(url, id)

给实例化图层添加模型,为后续具体的实例提供几何模型数据;
Parameters:
Name Type Description
url String 模型路径;
id Number 指定模型的唯一编号,用于查询、删除该模型;

addTo(map)

将图层添加到图层管理器中
Parameters:
Name Type Description
map Glodon.CIMCube 地图实例
Inherited From:
Overrides:

dispatchEvent(event)

在此事件派发器上派发事件.
Parameters:
Name Type Description
event Object 待派发的事件.
Inherited From:
Overrides:

dispose()

释放资源

flyTo()

飞行定位

getInstance(id)

按实例 id 查找实例,不存在则返回 undefined
Parameters:
Name Type Description
id Number | String 实例编号
Returns:
Type
InstanceLayerInstance | undefined

getModel(id)

获取模型对象,不存在的话返回undefined;
Parameters:
Name Type Description
id Number 模型的唯一编号;
Returns:
模型对象,不存在时为 undefined
Type
InstanceLayerModel | undefined

getParentId()

获取父节点ID
Inherited From:
Overrides:
Returns:
父节点ID
Type
String

removeDragHandle()

在场景中移除操作句柄
Inherited From:
Overrides:

removeModel(id)

删除模型对象
Parameters:
Name Type Description
id Number 模型的唯一编号;