viewerDynamicObjectMixin
A mixin which adds behavior to the Viewer widget for dealing with DynamicObject instances. This allows for DynamicObjects to be tracked with the camera, either by the viewer clicking on them, or by setting the trackedObject property. Rather than being called directly, this function is normally passed as a parameter to Viewer#extend, as shown in the example below.
Parameters:
Name | Type | Description |
---|---|---|
viewer |
Viewer | The viewer instance. |
Throws:
-
DeveloperError : viewer is required.
-
DeveloperError : trackedObject is already defined by another mixin.
Example
// Add support for working with DynamicObject instances to the Viewer. var dynamicObject = ... //A DynamicObject instance var viewer = new Viewer('cesiumContainer'); viewer.extend(viewerDynamicObjectMixin); viewer.trackedObject = dynamicObject; //Camera will now track dynamicObject
Members
-
trackedObject :DynamicObject
-
Gets or sets the DynamicObject instance currently being tracked by the camera.