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 Cesium.DynamicObject instance var viewer = new Cesium.Viewer('cesiumContainer'); viewer.extend(Cesium.viewerDynamicObjectMixin); viewer.trackedObject = dynamicObject; //Camera will now track dynamicObject
Members
-
objectTracked :Event
-
Gets an event that will be raised when an object is tracked by the camera. The event has two parameters: a reference to the viewer instance, and the newly tracked object.
-
trackedObject :DynamicObject
-
Gets or sets the DynamicObject instance currently being tracked by the camera.