DynamicLayer3D

new Cesium.DynamicLayer3D(context, urls)

Dynamic layer, a dynamic layer can contain multiple types of models, each model can contain multiple instances, each instance updates state information at a certain refresh interval DynamicObjectState to achieve dynamic effects.
Name Type Description
context Context webgl context object
urls Array Model url array.
Example:
var uls = ['model1.s3m','model2.s3m'];
var layer = new DynamicLayer3D(context,urls);
scene.primitives.add(layer);

Members

enableLocalOffset : boolean

Set whether to support the local offset of the model (the model comes with an offset matrix).

filterMode : Mode

Gets or sets the sub-object filtering mode, the default is distance mode.

filterPixel : Number

Gets or sets the filter pixel of the sub-object, the default is 0.

readonlygroup : Object

Get all the model grouping collection {url:object} of the dynamic layer.

maxVisibleAltitude : Number

Gets or sets the maximum visible height of the dynamic layer.

maxVisibleDistance : Number

Gets or sets the maximum visible distance of object filtering.

shadowType : ShadowType

Get or set the shadow mode. The default value is NONE.
Default Value: NONE

readonlytype : String

Get the ID of the layer type.

updateInterval : Number

Gets or sets the refresh interval of the dynamic layer, in ms.

visible : Boolean

Get or set the visibility of the dynamic layer.

Methods

clearAllState()

Clear the state information of all dynamic instance objects of the dynamic layer. All dynamic instances will not be rendered until the state is updated next time.
Example:
layer.clearAllState();

clearState(url, ids)

According to the model url and dynamic instance ID, the status information of the dynamic instance with the specified ID of the type of model is cleared, and the instance will not be rendered until the status is updated next time.
Name Type Description
url String Model 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 state is updated next time.
Example:
layer.deleteAllObjects();

deleteObjects(url, ids)

According to the model url and dynamic instance ID, delete the instance object corresponding to the ids of the specified type, and update the state of the same id again next time, the object with the corresponding 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 webgl resources.

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

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

getCullEnabled(url)boolean

Get whether single-sided rendering is enabled.
Name Type Description
url String Model url。
Returns:
Whether to enable single and double-sided rendering.

setCullEnabled(url, enabled)

Set whether to enable single and double-sided rendering.
Name Type Description
url String Model url。
enabled boolean Whether to enable single and double-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 The url of the dynamic layer.
enable Boolean It is optional when the value is true, but not when it is false.

setUnSelected()

Cancel the selected state of all instances

setVisibleByUrl(modelUrl, isVisible)

Set the visibility of all instances of the specified model type under the layer according to the url.
Name Type Description
modelUrl String Model url (specify model type).
isVisible Boolean Is it visible.
Example:
//Set all instances of type model.s3m to be invisible.
layer.setVisibleByUrl('model.s3m',false);

updateObjectWithModel(url, arrStates)

Update the object status information according to the specified model type (url).
Name Type Description
url String Model type url.
arrStates Array State information (DynamicObjectState) array.
Example:
//Update the status information of the model.s3m type instance
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: