English中文

Entity

new Cesium.Entity(options)

实体实例将多种形式的可视化聚合到单个高级对象中。它们可以手动创建并添加到 Entity instances aggregate multiple forms of visualization into a single high-level object. They can be created manually and added to Viewer#entities 或由数据源生成,例如 or be produced by data sources, such as CzmlDataSource and GeoJsonDataSource.
名称 Name 类型 Type 说明 Description
options Entity.ConstructorOptions 可选 optional 描述初始化选项的对象 Object describing initialization options
另见: See:

成员 Members

与此对象关联的可用性(如果有)。如果未定义可用性,则假定该对象的其他属性将在任何提供的时间内返回有效数据。如果存在可用性,则对象的其他属性仅在给定间隔内查询时才提供有效数据。 The availability, if any, associated with this object. If availability is undefined, it is assumed that this object's other properties will return valid data for any provided time. If availability exists, the objects other properties will only provide valid data if queried within the given interval.
获取或设置广告牌。 Gets or sets the billboard.
获取或设置框。 Gets or sets the box.
获取或设置走廊。 Gets or sets the corridor.
获取或设置圆柱体。 Gets or sets the cylinder.

readonly definitionChanged : Event

获取每当更改或修改属性或子属性时引发的事件。 Gets the event that is raised whenever a property or sub-property is changed or modified.
获取或设置描述。 Gets or sets the description.
获取或设置椭圆。 Gets or sets the ellipse.
获取或设置椭球体。 Gets or sets the ellipsoid.
获取或设置该实体所属的实体集合。 Gets or sets the entity collection that this entity belongs to.
获取与该对象关联的唯一 ID。 Gets the unique ID associated with this object.
获取此实体是否正在显示,同时考虑到任何祖先实体的可见性。 Gets whether this entity is being displayed, taking into account the visibility of any ancestor entities.
获取或设置标签。 Gets or sets the label.
获取或设置模型。 Gets or sets the model.

name : string|undefined

获取或设置对象的名称。该名称供最终用户使用,不需要是唯一的。 Gets or sets the name of the object. The name is intended for end-user consumption and does not need to be unique.
获取或设置相对于地球固定地心 (ECEF) 的方向。实体位置默认为东北向上。 Gets or sets the orientation in respect to Earth-fixed-Earth-centered (ECEF). Defaults to east-north-up at entity position.
获取或设置父对象。 Gets or sets the parent object.
获取或设置路径。 Gets or sets the path.
获取或设置平面。 Gets or sets the plane.
获取或设置点图形。 Gets or sets the point graphic.
获取或设置多边形。 Gets or sets the polygon.
获取或设置折线。 Gets or sets the polyline.
获取或设置折线体积。 Gets or sets the polyline volume.
获取或设置位置。 Gets or sets the position.
获取或设置与该实体关联的任意属性包。 Gets or sets the bag of arbitrary properties associated with this entity.

propertyNames : Array.<string>

获取在此实例上注册的所有属性的名称。 Gets the names of all properties registered on this instance.
获取或设置矩形。 Gets or sets the rectangle.
获取或设置是否应显示此实体。当设置为 true 时,仅当父实体的 show 属性也为 true 时才显示该实体。 Gets or sets whether this entity should be displayed. When set to true, the entity is only displayed if the parent entity's show property is also true.
获取或设置图块集。 Gets or sets the tileset.
获取或设置实体的跟踪参考系。 Gets or sets the entity's tracking reference frame.
演示: Demo:
获取或设置跟踪此对象时建议的初始偏移量。偏移通常在东西向参考系中定义,但也可能是另一个参考系,具体取决于对象的速度。 Gets or sets the suggested initial offset when tracking this object. The offset is typically defined in the east-north-up reference frame, but may be another frame depending on the object's velocity.
获取或设置墙。 Gets or sets the wall.

方法 Methods

static Cesium.Entity.supportsMaterialsforEntitiesOnTerrain(scene)boolean

检查给定场景是否支持除覆盖在地形或 3D Tiles上的实体上的颜色之外的材质。如果不支持此功能,则具有非颜色材质但没有“高度”的实体将被渲染为高度为 0。 Checks if the given Scene supports materials besides Color on Entities draped on terrain or 3D Tiles. If this feature is not supported, Entities with non-color materials but no `height` will instead be rendered as if height is 0.
名称 Name 类型 Type 说明 Description
scene Scene 现在的场景。 The current scene.
返回: Returns:
当前场景是否支持地形上实体的材质。 Whether or not the current scene supports materials for entities on terrain.

static Cesium.Entity.supportsPolylinesOnTerrain(scene)boolean

检查给定场景是否支持夹紧到地形或 3D Tiles的折线。如果不支持此功能,则具有 PolylineGraphics 的实体将在提供的高度处渲染顶点,并使用“arcType”参数而不是固定在地面上。 Checks if the given Scene supports polylines clamped to terrain or 3D Tiles. If this feature is not supported, Entities with PolylineGraphics will be rendered with vertices at the provided heights and using the `arcType` parameter instead of clamped to the ground.
名称 Name 类型 Type 说明 Description
scene Scene 现在的场景。 The current scene.
返回: Returns:
当前场景是否支持地形或 3D Tiles上的折线。 Whether or not the current scene supports polylines on terrain or 3D TIles.

addProperty(propertyName)

向该对象添加属性。添加属性后,可以通过以下方式观察它 Adds a property to this object. Once a property is added, it can be observed with Entity#definitionChanged 并复合有 and composited with CompositeEntityCollection
名称 Name 类型 Type 说明 Description
propertyName string 要添加的属性的名称。 The name of the property to add.
抛出: Throws:
  • DeveloperError :“propertyName”是保留的属性名称。 : "propertyName" is a reserved property name.
  • DeveloperError :“propertyName”已经是注册财产。 : "propertyName" is already a registered property.

computeModelMatrix(time, result)Matrix4

计算指定时间实体变换的模型矩阵。如果位置未定义,则返回未定义 Computes the model matrix for the entity's transform at specified time. Returns undefined if position is undefined
名称 Name 类型 Type 说明 Description
time JulianDate 检索模型矩阵的时间。 The time to retrieve model matrix for.
result Matrix4 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的 Matrix4 实例(如果未提供)。如果位置未定义,则结果未定义。 The modified result parameter or a new Matrix4 instance if one was not provided. Result is undefined if position is undefined.

isAvailable(time)boolean

给定一个时间,如果该对象在该时间段内应该有数据,则返回 true。 Given a time, returns true if this object should have data during that time.
名称 Name 类型 Type 说明 Description
time JulianDate 检查可用性的时间。 The time to check availability for.
返回: Returns:
如果对象在提供的时间内应该有数据,则为 true,否则为 false。 true if the object should have data during the provided time, false otherwise.
将此对象上每个未分配的属性分配给所提供的源对象上相同属性的值。 Assigns each unassigned property on this object to the value of the same property on the provided source object.
名称 Name 类型 Type 说明 Description
source Entity 要合并到此对象中的对象。 The object to be merged into this object.

removeProperty(propertyName)

删除了之前使用 addProperty 添加的属性。 Removed a property previously added with addProperty.
名称 Name 类型 Type 说明 Description
propertyName string 要删除的属性的名称。 The name of the property to remove.
抛出: Throws:
  • DeveloperError :“propertyName”是保留的属性名称。 : "propertyName" is a reserved property name.
  • DeveloperError :“propertyName”不是注册财产。 : "propertyName" is not a registered property.

类型定义 Type Definitions

Cesium.Entity.ConstructorOptions

实体构造函数的初始化选项 Initialization options for the Entity constructor
属性: Properties:
名称 Name 类型 Type Attributes 默认值 Default 说明 Description
id string <可选> &lt;optional>
该对象的唯一标识符。如果未提供,则会生成 GUID。 A unique identifier for this object. If none is provided, a GUID is generated.
name string <可选> &lt;optional>
显示给用户的人类可读名称。它不必是唯一的。 A human readable name to display to users. It does not have to be unique.
availability TimeIntervalCollection <可选> &lt;optional>
与此对象关联的可用性(如果有)。 The availability, if any, associated with this object.
show boolean <可选> &lt;optional>
一个布尔值,指示是否显示实体及其子实体。 A boolean value indicating if the entity and its children are displayed.
trackingReferenceFrame TrackingReferenceFrame <可选> &lt;optional>
TrackingReferenceFrame.AUTODETECT 跟踪该实体时使用的参考系。 The reference frame used when this entity is being tracked.
If undefined,参考系是根据实体速度确定的:近地表缓慢移动的实体使用局部东北向上参考系进行跟踪,而卫星等快速移动的实体则使用 VVLH(车辆速度,局部水平)进行跟踪。 , reference frame is determined based on entity velocity: near-surface slow moving entities are tracked using the local east-north-up reference frame, whereas fast moving entities such as satellites are tracked using VVLH (Vehicle Velocity, Local Horizontal).
description Property | string <可选> &lt;optional>
一个字符串属性,指定该实体的 HTML 描述。 A string Property specifying an HTML description for this entity.
position PositionProperty | Cartesian3 | CallbackPositionProperty <可选> &lt;optional>
指定实体位置的属性。 A Property specifying the entity position.
orientation Property | Quaternion <可选> &lt;optional>
Transforms.eastNorthUpToFixedFrame(position) 指定相对于地球固定地心 (ECEF) 的实体方向的属性。如果未定义,则使用实体位置的东北向上。 A Property specifying the entity orientation in respect to Earth-fixed-Earth-centered (ECEF). If undefined, east-north-up at entity position is used.
viewFrom Property | Cartesian3 <可选> &lt;optional>
查看此对象的建议初始偏移量。 A suggested initial offset for viewing this object.
parent Entity <可选> &lt;optional>
与该实体关联的父实体。 A parent entity to associate with this entity.
billboard BillboardGraphics | BillboardGraphics.ConstructorOptions <可选> &lt;optional>
与该实体关联的广告牌。 A billboard to associate with this entity.
box BoxGraphics | BoxGraphics.ConstructorOptions <可选> &lt;optional>
与该实体关联的框。 A box to associate with this entity.
corridor CorridorGraphics | CorridorGraphics.ConstructorOptions <可选> &lt;optional>
与该实体关联的走廊。 A corridor to associate with this entity.
cylinder CylinderGraphics | CylinderGraphics.ConstructorOptions <可选> &lt;optional>
与该实体关联的圆柱体。 A cylinder to associate with this entity.
ellipse EllipseGraphics | EllipseGraphics.ConstructorOptions <可选> &lt;optional>
与该实体关联的椭圆。 A ellipse to associate with this entity.
ellipsoid EllipsoidGraphics | EllipsoidGraphics.ConstructorOptions <可选> &lt;optional>
与该实体关联的椭球体。 A ellipsoid to associate with this entity.
label LabelGraphics | LabelGraphics.ConstructorOptions <可选> &lt;optional>
与该实体关联的 options.label。 A options.label to associate with this entity.
model ModelGraphics | ModelGraphics.ConstructorOptions <可选> &lt;optional>
与该实体关联的模型。 A model to associate with this entity.
tileset Cesium3DTilesetGraphics | Cesium3DTilesetGraphics.ConstructorOptions <可选> &lt;optional>
与该实体关联的 3D Tiles 瓷砖集。 A 3D Tiles tileset to associate with this entity.
path PathGraphics | PathGraphics.ConstructorOptions <可选> &lt;optional>
与该实体关联的路径。 A path to associate with this entity.
plane PlaneGraphics | PlaneGraphics.ConstructorOptions <可选> &lt;optional>
与该实体关联的平面。 A plane to associate with this entity.
point PointGraphics | PointGraphics.ConstructorOptions <可选> &lt;optional>
与该实体关联的点。 A point to associate with this entity.
polygon PolygonGraphics | PolygonGraphics.ConstructorOptions <可选> &lt;optional>
与该实体关联的多边形。 A polygon to associate with this entity.
polyline PolylineGraphics | PolylineGraphics.ConstructorOptions <可选> &lt;optional>
与该实体关联的折线。 A polyline to associate with this entity.
properties PropertyBag | Object.<string, *> <可选> &lt;optional>
与该实体关联的任意属性。 Arbitrary properties to associate with this entity.
polylineVolume PolylineVolumeGraphics | PolylineVolumeGraphics.ConstructorOptions <可选> &lt;optional>
与该实体关联的折线体积。 A polylineVolume to associate with this entity.
rectangle RectangleGraphics | RectangleGraphics.ConstructorOptions <可选> &lt;optional>
与该实体关联的矩形。 A rectangle to associate with this entity.
wall WallGraphics | WallGraphics.ConstructorOptions <可选> &lt;optional>
与该实体关联的墙。 A wall to associate with this entity.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.