DynamicLayer3D

new Cesium.DynamicLayer3D(context, urls)

动态图层,一个动态图层可以包含多种类型的模型,每种模型又能包含多个实例,每个实例以一定刷新间隔更新状态信息DynamicObjectState,从而达到动态效果。
Name Type Description
context Context webgl context对象。
urls Array 模型url数组。
Example:
var uls = ['model1.s3m','model2.s3m'];
var layer = new DynamicLayer3D(context,urls);
scene.primitives.add(layer);

Members

enableLocalOffset : boolean

设置是否支持模型局部偏移(模型自带偏移矩阵)。

readonlygroup : Object

获取动态图层的所有模型分组集合{url:object}。

maxVisibleAltitude : Number

获取或者设置动态图层的最大可见高度。

readonlytype : String

获取该图层类型标识。

updateInterval : Number

获取或者设置动态图层的刷新间隔时间,单位ms。

visible : Boolean

获取或者设置动态图层的可见性。

Methods

clearAllState()

Clears the state information of all dynamic instance objects of the dynamic layer, and all dynamic instances are not rendered until the next update state.
Example:
layer.clearAllState();

clearState(url, ids)

According to the model url and the dynamic instance ID, the state information of the dynamic instance of the type model specified ID is cleared, and the instance is not rendered until the state is updated next time.
Name Type Description
url String 模型url。
ids Array Dynamic instance ids.
Example:
layer.clearState('ship.s3m',[1]);

deleteAllObjects()

Delete all dynamic instance objects of the dynamic layer, and all dynamic instances will not be rendered until the next update state.
Example:
layer.deleteAllObjects();

deleteObjects(url, ids)

According to the model url and the dynamic instance ID, the instance object corresponding to the id of the specified type is deleted, and the state of the same id is updated again next time, and the object corresponding to the id will not be rendered.
Name Type Description
url String Model url.
ids Array Dynamic instance ids.
Example:
layer.deleteObjects('ship.s3m',[1]);

destroy()undefined

Release the webgl resource.

Once the object resource is released, it will not be used; calling any method will throw a DeveloperError exception.

Returns:
Example:
layer = layer && layer.destroy();
See:
  • DynamicLayer3D#isDestroyed

getCullEnabled(url)boolean

Get whether to enable single-sided rendering.
Name Type Description
url String Model url.
Returns:
Whether to enable single-sided rendering.

setCullEnabled(url, enabled)

Set whether to enable single-sided rendering.
Name Type Description
url String Model url.
enabled boolean Whether to enable single-sided rendering.

setPickEnable(url, enable)

Set whether the model instance corresponding to the url is optional according to the url of the dynamic layer.
Name Type Description
url String 动态图层的url。
enable Boolean It is optional when the value is true, and is not optional when it is false.

setUnSelected()

Cancel the selected state of all instances

setVisibleByUrl(modelUrl, isVisible)

Sets the visibility of all instances of the specified model type under this layer based on the url.
Name Type Description
modelUrl String Model url (specified model type).
isVisible Boolean Is it visible?
Example:
//设置model.s3m类型的所有实例不可见。
layer.setVisibleByUrl('model.s3m',false);

updateObjectWithModel(url, arrStates)

根据指定模型类型(url)更新对象状态信息。
Name Type Description
url String 模型类型url。
arrStates Array An array of status information (DynamicObjectState).
Example:
//更新model.s3m类型实例的状态信息
var states = [];
states.push(new DynamicObjectState({id : 1,longitude : 100,latitude : 10}));
states.push(new DynamicObjectState({id : 2,longitude : 101,latitude : 11}));
layer.updateObjectWithModel('model.s3m',states);
See: