PrimitiveCollection
A collection of primitives. This is most often used with Scene.primitives, but PrimitiveCollection
is also a primitive itself so collections can be added to collections forming a hierarchy.
const billboards = new BillboardCollection();
const labels = new LabelCollection();
const collection = new PrimitiveCollection();
collection.add(billboards);
scene.primitives.add(collection); // Add collection
scene.primitives.add(labels); // Add regular primitive
See also
Properties
Determines if primitives in the collection are destroyed when they are removed by PrimitiveCollection.destroy or PrimitiveCollection.remove or implicitly by PrimitiveCollection.removeAll.
An event that is raised when a primitive is added to the collection. Event handlers are passed the primitive that was added.
An event that is raised when a primitive is removed from the collection. Event handlers are passed the primitive that was removed.
Functions
Returns true if this object was destroyed; otherwise, false.
Lowers a primitive to the "bottom" of the collection. If all primitives in the collection are drawn on the globe surface, this visually moves the primitive to the bottom.
Raises a primitive to the "top" of the collection. If all primitives in the collection are drawn on the globe surface, this visually moves the primitive to the top.