Cesium Primitive and Entity APIs

434 views
Skip to first unread message

ringow...@gmail.com

unread,
Apr 16, 2016, 11:45:40 PM4/16/16
to cesium-dev
I'm trying to find/understand Cesium APIs with a view to interface it to scala.js.

The "Visualizing Spatial Data" tutorial mentions the low level primitive API and the high-level Entity API, and I want to focus on just the Entity API.

From the Cesium website Documentation link, I can see an API and I assume this is the primitive API. Is there a link to the Entity API somewhere? If the Entity API is intermingled in this API, is there a way to determine what part is the Entity API?

I'm asking this because looking at the "Entity" documentation, it takes things like:
BillboardGraphics,PolygonGraphics, ...etc.
However in the examples Billboard, Polygon, ... etc are used.
The description of these are quite different from their xxxxGraphics.
I feel I missing something fundamental here. Similarly I can never find the CZML documentation from the website.

Mark Erikson

unread,
Apr 17, 2016, 1:58:34 PM4/17/16
to cesium-dev, ringow...@gmail.com
The "Primitive API" and "Entity API" are terms used to describe different classes and types within the overall Cesium codebase and API.

"Primitives" are the lower-level pieces like Billboards, Labels, and Polylines, which are created using their respective collection classes like BillboardCollection.  You are responsible for managing the details of those items yourself.

"Entities" are a higher-level concept, where a single "Entity" could have multiple bits of display representation at once (a Billboard, a Label, a Polyline, a Polygon, etc).  Entities are automatically created when data sources like CZML or KML are loaded, and you can also manually create Entity instances that aren't tied to a data source as well.  The Entity class uses the "[type]Graphics" classes to display and manage Primitives based on its own data.  So, an Entity that is showing an icon would have a BillboardGraphics instance attached, and the BillboardGraphics instance would watch for changes in the Entity's position and update a primitive Billboard appropriately.  (The "[type]Visualizer" classes also fit into that sequence somewhere.)

See the following docs pages for more info and examples:


Reply all
Reply to author
Forward
0 new messages