Entity

Entity instances aggregate multiple forms of visualization into a single high-level object. They can be created manually and added to entity collection.

Constructor

new Entity(optionsopt)

Parameters:
NameTypeAttributesDescription
optionsObject<optional>

Entity options:

Properties
NameTypeAttributesDescription
namestring<optional>

A human-readable name to display to users. It does not have to be unique.

cartesianVec3 | Array.<number><optional>

Spatial entities like billboard, label etc. cartesian position.

lonlatLonLat<optional>

Geodetic coordinates for an entities like billboard, label etc.

agroundboolean<optional>

True for entities that have to be placed on the relief.

visibilityboolean<optional>

Entity visibility.

billboard*<optional>

Billboard options(see Billboard).

label*<optional>

Label options(see Label).

polyline*<optional>

Polyline options(see Polyline).

ray*<optional>

Ray options(see Ray).

pointCloud*<optional>

Point cloud options(see PointCloud).

geometry*<optional>

Geometry options (see Geometry), available for vector layer only.

properties*<optional>

Entity custom properties.

Methods

_setCartesian3vSilent(cartesian, skipLonLat)

Sets entity cartesian position without event dispatching.

Parameters:
NameTypeDefaultDescription
cartesianVec3

Cartesian position in 3d space.

skipLonLatbooleanfalse

skip geodetic calculation.

addTo(collection, rightNowopt) → {Entity}

Adds current entity into the specified entity collection.

Parameters:
NameTypeAttributesDefaultDescription
collectionEntityCollection | Vector

Specified entity collection or vector layer.

rightNowBoolean<optional>
false

Entity insertion option for vector layer.

Returns:
  • This object.
Type: 
Entity

appendChild(entity)

Append child entity.

Parameters:
NameTypeDescription
entityEntity

Child entity.

getAltitude() → {number}

Sets entity altitude over the planet.

Returns:

Altitude.

Type: 
number

getCartesian() → {Vec3}

Returns cartesian position.

Returns:
Type: 
Vec3

getExtent() → {Extent}

Return geodetic extent.

Returns:
Type: 
Extent

getLonLat() → {LonLat}

Gets entity geodetic coordinates.

Returns:
Type: 
LonLat

getVisibility() → {boolean}

Returns entity visibility.

Returns:
Type: 
boolean

remove()

Removes current entity from collection and layer.

setAltitude(altitude)

Sets entity altitude over the planet.

Parameters:
NameTypeDescription
altitudenumber

Altitude.

setBillboard(billboard) → {Billboard}

Sets entity billboard.

Parameters:
NameTypeDescription
billboardBillboard

Billboard object.

Returns:
Type: 
Billboard

setCartesian(x, y, z)

Sets entity cartesian position.

Parameters:
NameTypeDescription
xnumber

3d space X - position.

ynumber

3d space Y - position.

znumber

3d space Z - position.

setCartesian3v(cartesian)

Sets entity cartesian position.

Parameters:
NameTypeDescription
cartesianVec3

Cartesian position in 3d space.

setGeoObject(geoObject) → {GeoObject}

Sets entity geoObject.

Parameters:
NameTypeDescription
geoObjectGeoObject

GeoObject.

Returns:
Type: 
GeoObject

setGeometry(geometry) → {Geometry}

Sets entity geometry.

Parameters:
NameTypeDescription
geometryGeometry

Geometry object.

Returns:
Type: 
Geometry

setLabel(label) → {Label}

Sets entity label.

Parameters:
NameTypeDescription
labelLabel

Text label.

Returns:
Type: 
Label

setLonLat(lonlat)

Sets geodetic coordinates of the entity point object.

Parameters:
NameTypeDescription
lonlatLonLat

WGS84 coordinates.

setLonLat2(lon, lat, heightopt)

Sets geodetic coordinates of the entity point object.

Parameters:
NameTypeAttributesDescription
lonnumber

Longitude.

latnumber

Latitude

heightnumber<optional>

Height

setPickingColor()

Appends entity items(billboard, label etc.) picking color.

setPointCloud(pointCloud) → {PointCloud}

Sets entity pointCloud.

Parameters:
NameTypeDescription
pointCloudPointCloud

PointCloud object.

Returns:
Type: 
PointCloud

setPolyline(polyline) → {Polyline}

Sets entity polyline.

Parameters:
NameTypeDescription
polylinePolyline

Polyline object.

Returns:
Type: 
Polyline

setRay(ray) → {Ray}

Sets entity ray.

Parameters:
NameTypeDescription
rayRay

Ray object.

Returns:
Type: 
Ray

setStrip(strip) → {Strip}

Sets entity strip.

Parameters:
NameTypeDescription
stripStrip

Strip object.

Returns:
Type: 
Strip

setVisibility(visibility)

Sets the entity visibility.

Parameters:
NameTypeDescription
visibilityboolean

Entity visibility.