ReferenceProperty

external class ReferenceProperty(val targetCollection: EntityCollection, val targetId: String, val targetPropertyNames: ReadonlyArray<String>)(source)

A Property which transparently links to another property on a provided object.

const collection = new EntityCollection();

//Create a new entity and assign a billboard scale.
const object1 = new Entity({id:'object1'});
object1.billboard = new BillboardGraphics();
object1.billboard.scale = new ConstantProperty(2.0);
collection.add(object1);

//Create a second entity and reference the scale from the first one.
const object2 = new Entity({id:'object2'});
object2.model = new ModelGraphics();
object2.model.scale = new ReferenceProperty(collection, 'object1', ['billboard', 'scale']);
collection.add(object2);

//Create a third object, but use the fromString helper function.
const object3 = new Entity({id:'object3'});
object3.billboard = new BillboardGraphics();
object3.billboard.scale = ReferenceProperty.fromString(collection, 'object1#billboard.scale');
collection.add(object3);

//You can refer to an entity with a # or . in id and property names by escaping them.
const object4 = new Entity({id:'#object.4'});
object4.billboard = new BillboardGraphics();
object4.billboard.scale = new ConstantProperty(2.0);
collection.add(object4);

const object5 = new Entity({id:'object5'});
object5.billboard = new BillboardGraphics();
object5.billboard.scale = ReferenceProperty.fromString(collection, '\\#object\\.4#billboard.scale');
collection.add(object5);

See also

Constructors

Link copied to clipboard
constructor(targetCollection: EntityCollection, targetId: String, targetPropertyNames: ReadonlyArray<String>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Gets the event that is raised whenever the definition of this property changes. The definition is changed whenever the referenced property's definition is changed.

Link copied to clipboard

Gets a value indicating if this property is constant.

Link copied to clipboard

Gets the reference frame that the position is defined in. This property is only valid if the referenced property is a PositionProperty.

Link copied to clipboard

Gets the resolved instance of the underlying referenced property.

Link copied to clipboard

The entity collection which will be used to resolve the reference.

Link copied to clipboard

The id of the entity which is being referenced.

Link copied to clipboard

The names of the property on the target entity which we will use.

Functions

Link copied to clipboard

Gets the Material type at the provided time. This method is only valid if the property being referenced is a MaterialProperty.

Link copied to clipboard
fun getValue(time: JulianDate? = definedExternally, result: Any? = definedExternally): Any

Gets the value of the property at the provided time.

Link copied to clipboard
fun getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result: Cartesian3? = definedExternally): Cartesian3

Gets the value of the property at the provided time and in the provided reference frame. This method is only valid if the property being referenced is a PositionProperty.