DynamicLayer3D

new SuperMap3D.DynamicLayer3D(context, urls)

Dynamic graph layer, a dynamic graph layer can contain multiple types of models, each model can contain multiple instances, and each instance updates state information at one-time intervalsDynamicObjectState, so as to achieve a dynamic effect.
Name Type Description
context Context webgl context object.
urls Array Array of model urls.
Example:
var uls = ['model1.s3m','model2.s3m'];
var layer = new DynamicLayer3D(context,urls);
scene.primitives.add(layer);

Members

enableLocalOffset : boolean

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

filterMode : Mode

Get or set the sub-object filtering mode, the default is distance mode.

filterPixel : Number

Get or set sub-object filter pixels, the default is 0.

readonlygroup : Object

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

maxVisibleAltitude : Number

Get or set the maximum visible height of the dynamic layer.

maxVisibleDistance : Number

Gets or sets the maximum visible distance for object filtering.

shadowType : ShadowType

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

readonlytype : String

Get the layer type id.

updateInterval : Number

Get or set 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 this dynamic layer, and 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, clear the state information of the dynamic instance with the specified ID of this type of model, and the instance will not be rendered until the next state update.
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 this 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, 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 webgl resources.

Once the object resource is released, it cannot be used; calling any method will throwDeveloperErrorabnormal.

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

getCullEnabled(url)boolean

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

setCullEnabled(url, enabled)

Set whether to enable single-sided and double-sided rendering.
Name Type Description
url String model url。
enabled boolean Set whether to enable single-sided and double-sided rendering.

setPickEnable(url, enable)

According to the url of the dynamic layer, set whether the model instance corresponding to the url is optional.
Name Type Description
url String The URL of the dynamic layer.
enable Boolean It is optional when its value is true, and not optional when it is false.

setUnSelected()

Uncheck all instances

setVisibleByUrl(modelUrl, isVisible)

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

updateObjectWithModel(url, arrStates)

Update object state 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: