Constructor
new EntityCollection(optionsopt)
Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | <optional> | Entity options: Properties
|
- EntityCollection#event:draw
- EntityCollection#event:drawend
- EntityCollection#event:add
- EntityCollection#event:remove
- EntityCollection#event:entityadd
- EntityCollection#event:entityremove
- EntityCollection#event:visibilitychange
- EntityCollection#event:mousemove
- EntityCollection#event:mouseenter
- EntityCollection#event:mouseleave
- EntityCollection#event:lclick
- EntityCollection#event:rclick
- EntityCollection#event:mclick
- EntityCollection#event:ldblclick
- EntityCollection#event:rdblclick
- EntityCollection#event:mdblclick
- EntityCollection#event:lup
- EntityCollection#event:rup
- EntityCollection#event:mup
- EntityCollection#event:ldown
- EntityCollection#event:rdown
- EntityCollection#event:mdown
- EntityCollection#event:lhold
- EntityCollection#event:rhold
- EntityCollection#event:mhold
- EntityCollection#event:mousewheel
- EntityCollection#event:touchmove
- EntityCollection#event:touchstart
- EntityCollection#event:touchend
- EntityCollection#event:doubletouch
- EntityCollection#event:touchleave
- EntityCollection#event:touchenter
Methods
(protected) _updateGeodeticCoordinates(ellipsoid)
Updates coordinates all lonLat entities in collection after collection attached to the planet node.
Name | Type | Description |
---|---|---|
ellipsoid | Ellipsoid | Globe ellipsoid. |
add(entity) → {EntityCollection}
Adds entity to the collection and returns collection.
Name | Type | Description |
---|---|---|
entity | Entity | Entity. |
- Type:
- EntityCollection
addEntities(entities) → {EntityCollection}
Adds entities array to the collection and returns collection.
Name | Type | Description |
---|---|---|
entities | Array.<Entity> | Entities array. |
- Type:
- EntityCollection
addTo(renderNode, isHiddenopt) → {EntityCollection}
Adds this collection to render node.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
renderNode | RenderNode | Render node. | ||
isHidden | boolean | <optional> | false | Uses in vector layers that render in planet render specific function. |
- Type:
- EntityCollection
belongs(entity) → {boolean}
Returns true if the entity belongs this collection, otherwise returns false.
Name | Type | Description |
---|---|---|
entity | Entity | Entity. |
- Type:
- boolean
bindRenderNode(renderNode)
This function is called in the RenderNode assign function.
Name | Type | Description |
---|---|---|
renderNode | RenderNode |
clear()
Removes all entities from collection and clear handlers.
createPickingColors()
Creates or refresh collected entities picking color.
each(callback)
Safety entities loop.
Name | Type | Description |
---|---|---|
callback | function | Entity callback. |
getEntities() → {Array.<Entity>}
Gets entity array.
- Type:
- Array.<Entity>
getOpacity() → {number}
Gets collection opacity.
- Type:
- number
getVisibility() → {boolean}
Returns collection visibility.
- Type:
- boolean
reindexEntitiesArray(startIndex)
Refresh collected entities indexes from startIndex entities collection array position.
Name | Type | Description |
---|---|---|
startIndex | number | Entities collection array index. |
remove()
Removes collection from render node.
removeEntity(entity)
Removes entity from this collection.
Name | Type | Description |
---|---|---|
entity | Entity | Entity to remove. |
setOpacity(opacity)
Sets collection opacity.
Name | Type | Description |
---|---|---|
opacity | number | Opacity. |
setPickingEnabled(enable)
Sets collection picking ability.
Name | Type | Description |
---|---|---|
enable | boolean | Picking enable flag. |
setScaleByDistance(near, far, farInvisibleopt)
Sets scale by distance parameters.
Name | Type | Attributes | Description |
---|---|---|---|
near | number | Full scale entity distance. | |
far | number | Zero scale entity distance. | |
farInvisible | number | <optional> | Entity visibility distance. |
setVisibility(visibility)
Sets collection visibility.
Name | Type | Description |
---|---|---|
visibility | boolean | Visibility flag. |
updateBillboardsTextureAtlas()
Updates billboard texture atlas.
updateLabelsFontAtlas()
Updates labels font atlas.
Events
add
Triggered when added to the render node.
doubletouch
Triggered entity double touch.
draw
Triggered when collection entities begin draw.
drawend
Triggered after collection has drawn.
entityadd
Triggered when new entity added to the collection.
entityremove
Triggered when entity removes from the collection.
lclick
Mouse left button clicked.
ldblclick
Mouse left button double click.
ldown
Mouse left button is just pressed down(start pressing).
lhold
Mouse left button is pressing.
lup
Mouse left button up(stop pressing).
mclick
Mouse right button clicked.
mdblclick
Mouse middle button double click.
mdown
Mouse middle button is just pressed down(start pressing).
mhold
Mouse middle button is pressing.
mouseenter
Triggered when mouse has entered over the entity.
mouseleave
Triggered when mouse leaves the entity.
mousemove
Triggered when mouse moves over the entity.
mousewheel
Mouse wheel is rotated.
mup
Mouse middle button up(stop pressing).
rclick
Mouse right button clicked.
rdblclick
Mouse right button double click.
rdown
Mouse right button is just pressed down(start pressing).
remove
Triggered when removed from the render node.
rhold
Mouse right button is pressing.
rup
Mouse right button up(stop pressing).
touchend
Triggered when entity ends touching.
touchenter
Triggered when touch enters over the entity.
touchleave
Triggered when touching leaves entity.
touchmove
Triggered when touch moves over the entity.
touchstart
Triggered when entity begins to touch.
visibilitychange
Triggered when visibility changes.