new Entity(options)
Entity instance class, which aggregates multiple visual objects into a single high-level object. Entities can be manually created and added to Viewer # entities, or generated by data sources such as CzmlDataSource and GeoJsonDataSource.
| Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
optional
Object is an object that contains the following properties:
|
Members
-
availabilityTimeIntervalCollection
-
The availability of objects. If availability is not defined, it is assumed that other properties of the object will return valid data at any time. If there is availability, other properties of the object will only provide valid data within the given time interval of the query.
-
billboardBillboardGraphics
-
Gets or sets the billboard object.
-
boxBoxGraphics
-
Get or set a rectangular object.
-
corridorCorridorGraphics
-
Retrieve or set corridor objects.
-
cylinderCylinderGraphics
-
Get or set a cylindrical object.
-
readonly definitionChangedEvent
-
The event triggered when a property or sub property changes or is modified.
-
descriptionProperty
-
Get or set entity description.
-
ellipseEllipseGraphics
-
Get or set an elliptical object.
-
ellipsoidEllipsoidGraphics
-
Get or set an ellipsoid object.
-
entityCollectionEntityCollection
-
Get or set the entity collection to which this entity belongs.
-
idString
-
Get the unique identifier of the entity.
-
isShowingBoolean
-
Obtain the visibility of this entity, which takes into account its set of entities and the visibility of its parent entity.
-
labelLabelGraphics
-
Get or set tags.
-
modelModelGraphics
-
Retrieve or set model objects.
-
nameString
-
Get or set the name of an object. The name is intended for end-users and does not need to be unique.
-
orientationProperty
-
Get or set the orientation of an entity.
-
parentEntity
-
Get or set the parent object of an entity.
-
pathPathGraphics
-
Get or set the path object.
-
planePlaneGraphics
-
Get or set a planar object.
-
pointPointGraphics
-
Get or set point graphic objects.
-
polygonPolygonGraphics
-
Get or set polygon objects.
-
polylinePolylineGraphics
-
Get or set a polyline object.
-
polylineVolumePolylineVolumeGraphics
-
Get or set polyline column objects.
-
positionPositionProperty
-
Get or set the location of the entity.
-
propertiesPropertyBag
-
Get or set any property package associated with the entity object.
-
propertyNamesArray
-
Get all property names of the instance object.
-
rectangleRectangleGraphics
-
Get or set a rectangular object.
-
scaleProperty
-
Get or set the scaling ratio of an entity.
-
showBoolean
-
Get or set the visibility of entity objects. If set to true, this entity will only be displayed when its parent entity's display property show is also set to true.
-
viewFromProperty
-
Get or set the recommended initial offset when viewing this object with a camera. Offset is defined in the "East North Up" coordinate system.
-
wallWallGraphics
-
Get or set the fence object.
Methods
-
static supportsMaterialsforEntitiesOnTerrain(scene){Boolean}
-
Check if the specified scene supports pasting materials other than solid colors and 3D tiles. If not supported, the entity will be rendered with a non solid color material, but the height will be rendered as 0.
Name Type Description sceneScene The current scene.
Returns:
Type Description Boolean Whether or not the current scene supports materials for entities on terrain. -
static supportsPolylinesOnTerrain(scene){Boolean}
-
Check if the specified scene supports line to ground and 3D tiles. If not supported, PolylineGraphics will be rendered at the given height and rendered using arcType parameters instead of ground parameters.
Name Type Description sceneScene Current scene.
Returns:
Type Description Boolean Does the given scene support line to ground, 3D tiles. -
addProperty(propertyName)
-
Add an attribute to the entity.
Name Type Description propertyNameString The name of the attribute to be added.
Throws:
-
-
'Property Name' has been reserved.
- Type
- DeveloperError
-
-
-
'Property Name' has already been registered.
- Type
- DeveloperError
-
-
-
computeModelMatrix(time, result){Matrix4}
-
Calculate the model matrix of the entity at a given time. If position and orientation are undefined, it will return undefined.
Name Type Description timeJulianDate Given time.
resultMatrix4 optional Object for storing results
Returns:
Type Description Matrix4 If position and orientation are undefined, it will return undefined. If position or orientation is defined and input parameters are provided, the modified input object will be returned. On the contrary, create a new instance to store the results. -
isAvailable(time){Boolean}
-
If the object contains data within the specified time, return true.
Name Type Description timeJulianDate Check the availability time.
Returns:
Type Description Boolean If the object contains data within the specified time, return true; otherwise, return false. -
merge(source)
-
Assign the same attribute value as the source object to each unassigned attribute of the object.
Name Type Description sourceEntity Objects to be merged into the target object.
-
removeProperty(propertyName)
-
Delete the property names previously added through the addProperty function.
Name Type Description propertyNameString The name of the property to remove.
Throws:
-
-
'Property Name' has been reserved.
- Type
- DeveloperError
-
-
-
'Property Name' has already been registered.
- Type
- DeveloperError
-
-
-
setPolygonOffset(polyOffsetFactor, polyOffsetUnits)
-
Sets the polygon offset for the entity (currently only supports polygons).
Name Type Description polyOffsetFactorNumber The polygon offset constant. When positive, the polygon is offset away from the viewer; when negative, it is offset towards the viewer.
polyOffsetUnitsNumber Polygon scaling factor. The polygon scaling factor and offset constant together determine the offset of polygon objects in the depth direction of the screen, which can be used to solve the problem of flickering when polygons overlap.