ReferenceProperty

new Cesium.ReferenceProperty(targetCollection, targetId, targetPropertyNames)

61165透明地提供了指向另一个对象的属性。
Name Type Description
targetCollection EntityCollection 将用于解析引用的实体集合。
targetId String 正在引用的实体的id。
targetPropertyNames Array.<String> 我们将使用的目标实体上的属性的名称。
Example:
var collection = new Cesium.EntityCollection();

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

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

//Create a third object, but use the fromString helper function.
var object3 = new Cesium.Entity({id:'object3'});
object3.billboard = new Cesium.BillboardGraphics();
object3.billboard.scale = Cesium.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.
var object4 = new Cesium.Entity({id:'#object.4'});
object4.billboard = new Cesium.BillboardGraphics();
object4.billboard.scale = new Cesium.ConstantProperty(2.0);
collection.add(object4);

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

Members

readonly definitionChanged : Event

获取每当此属性的定义更改时引发的事件。 每当引用属性的定义发生更改时,定义都会更改。

readonly isConstant : Boolean

获取一个值,该值指示此属性是否为常量。
获取在其中定义位置的参考帧。 此属性仅在引用的属性为PositionProperty时有效。

readonly resolvedProperty : Property|undefined

获取基础引用属性的已解析实例。
获取包含正在引用的实体的集合。

readonly targetId : String

获取正在引用的实体的id。

readonly targetPropertyNames : Array.<String>

获取用于检索引用属性的属性名数组。

Methods

static Cesium.ReferenceProperty.fromString(targetCollection, referenceString)ReferenceProperty

如果实体集合将 用于解析它和指示目标实体id和属性的字符串。 字符串的格式是“objectId”#美食酒吧,其中#将id与 属性路径和。分离子属性。如果参考标识符或 或任何子属性包含#。或者他们必须逃走。
Name Type Description
targetCollection EntityCollection
referenceString String
Returns:
ReferenceProperty的新实例。
Throws:

equals(other)Boolean

将此属性与提供的属性进行比较并返回 如果相等,则为true,否则为false
Name Type Description
other Property optional 其他财产。
Returns:
如果左右相等,则为true,否则为false

getType(time)String

在提供的时间获取Material类型。 只有引用的属性是MaterialProperty时,此方法才有效。
Name Type Description
time JulianDate 检索类型的时间。
Returns:
材料的类型。

getValue(time, result)Object

获取属性在提供的时间的值。
Name Type Description
time JulianDate 检索值的时间。
result Object optional 要将值存储到其中的对象(如果省略),将创建并返回一个新实例。
Returns:
修改后的结果参数或新实例(如果未提供结果参数)。

getValueInReferenceFrame(time, referenceFrame, result)Cartesian3

获取提供时间和提供的参考帧中属性的值。 只有当被引用的属性是PositionProperty时,此方法才有效。
Name Type Description
time JulianDate 检索值的时间。
referenceFrame ReferenceFrame 结果的所需参考帧。
result Cartesian3 optional 要将值存储到其中的对象(如果省略),将创建并返回一个新实例。
Returns:
修改后的结果参数或新实例(如果未提供结果参数)。