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
-
Set whether to support the local offset of the model (the model comes with an offset matrix).
-
Gets or sets the sub-object filtering mode, the default is distance mode.
-
Gets or sets the filter pixel of the sub-object, the default is 0.
-
Get all the model grouping collection {url:object} of the dynamic layer.
-
Gets or sets the maximum visible height of the dynamic layer.
-
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
-
Get the ID of the layer type.
-
Gets or sets the refresh interval of the dynamic layer, in ms.
-
Get or set the visibility of the dynamic layer.
Methods
-
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();
-
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]);
-
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();
-
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]);
-
Release webgl resources.
Once the object resource is released, it cannot be used; calling any method will throw an
DeveloperError
exception.Returns:
- DynamicLayer3D#isDestroyed
Example:
layer = layer && layer.destroy();
See:
-
Get whether single-sided rendering is enabled.
Name Type Description url
String Model url。 Returns:
Whether to enable single and double-sided rendering. -
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. -
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. -
Cancel the selected state of all instances
-
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);
-
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: