Class: InstanceLayerModel

Glodon.CIMCube.Layer. InstanceLayerModel

实例化图层模型,用于描述要实例化的几何对象属性;

new InstanceLayerModel(options)

实例化图层模型构造函数
Parameters:
Name Type Description
options Object 初始化参数;
Properties
Name Type Argument Description
url string <optional>
模型数据的地址;
id string <optional>
该模型的唯一id;
origin Array <optional>
实例图层原点;
layer Array <optional>
实例图层原点;

Members


boundingSphere :Cesium.BoundingSphere

获取该模型包围球
Type:
  • Cesium.BoundingSphere

id :Number

模型id
Type:
  • Number

instanceData :Object

获取实例化数据,也就是经由setInstanceData设置的数据, 该对象会随着新实例的添加,旧实例的删除与修改而改变;
Type:
  • Object

position :Array

模型原点,地理坐标系
Type:
  • Array

show :Boolean

该模型实例是否显示
Type:
  • Boolean

url :String

模型地址
Type:
  • String

Methods


add(data)

添加新的实例, data结构同setInstanceData
Parameters:
Name Type Description
data Object

get(id)

获取指定编号的实例
Parameters:
Name Type Description
id Number 实例编号

getInstancePosition(ins)

获取实例坐标
Parameters:
Name Type Description
ins Object 实例参数
Returns:
Type
Array

getModelInstance(id)

获取原生模型实例
Parameters:
Name Type Description
id String
Returns:
Type
Cesium.ModelInstance

remove(id)

移除指定实例
Parameters:
Name Type Description
id Number 实例编号

removeAll()

移除所有该模型的实例;

setInstanceData(data)

设置实例化数据,用来具体实例化该模型; 重复设置会先删除此前的数据;
Parameters:
Name Type Description
data Object 实例化数据,结构见下
Example
[
            {
                id: "1",
                position: [],/// default:0,0,0
                rotation: [],/// default:0,0,0
                scale: 1.0
            },
            ...
        ];