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 intervals
DynamicObjectState
, 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
-
Set whether to support model local offset (the model comes with an offset matrix).
-
Get or set the sub-object filtering mode, the default is distance mode.
-
Get or set sub-object filter pixels, the default is 0.
-
Get all model grouping collection {url:object} of dynamic layer.
-
Get or set the maximum visible height of the dynamic layer.
-
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
-
Get the layer type id.
-
Get or set 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 this dynamic layer, and 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, 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]);
-
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();
-
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]);
-
Release webgl resources.
Once the object resource is released, it cannot be used; calling any method will throw
DeveloperError
abnormal.Returns:
- DynamicLayer3D#isDestroyed
Example:
layer = layer && layer.destroy();
See:
-
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. -
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. -
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. -
Uncheck all instances
-
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);
-
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: