new InstanceLayerModel(options)
实例化图层模型构造函数
Parameters:
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | 初始化参数;
Properties
|
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 dataObject -
get(id)
-
获取指定编号的实例
Parameters:
Name Type Description idNumber 实例编号 -
getInstancePosition(ins)
-
获取实例坐标
Parameters:
Name Type Description insObject 实例参数 Returns:
- Type
- Array
-
getModelInstance(id)
-
获取原生模型实例
Parameters:
Name Type Description idString Returns:
- Type
- Cesium.ModelInstance
-
remove(id)
-
移除指定实例
Parameters:
Name Type Description idNumber 实例编号 -
removeAll()
-
移除所有该模型的实例;
-
setInstanceData(data)
-
设置实例化数据,用来具体实例化该模型; 重复设置会先删除此前的数据;
Parameters:
Name Type Description dataObject 实例化数据,结构见下 Example
[ { id: "1", position: [],/// default:0,0,0 rotation: [],/// default:0,0,0 scale: 1.0 }, ... ];