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 是否使用一般的光照模型(冯氏光照)
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

boundingSphere :BoundingSphere

图层包围球
Type:
  • BoundingSphere

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:

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:

Methods


addDragHandle(options)

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

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 模型的唯一编号;

getParentId()

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

removeDragHandle()

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

removeModel(id)

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