How can i create and position a composite entity in cesium?

By composite, I mean consisting of arbitrary structure (e.g. billboard with 2 differently styled labels ).

The problem is that an Entity can only get one item of each type (1 billboard, 1 label, etc.). In addition, there’s no way to group several entities (there is but…) and influence their position alltogether.

As a second thought, I tried to import a complex model (with arbitrary structure) that can be moved around as one unit. Is there a way to manipulate that model instance at runtime (e.g. change a label text within)? I know that animations are available in models, but I need more than that.

Thanks in advance for any assistance.

1 Like

I think it may be easier if you abstract this functionality in your application. You can define some kind of container that takes a list of entities and moves them all together.

What is in your models that need to move together? Is it like a vehicle with multiple labels on it?

Hi Omar,

I work on this very same project.
We try to show an entity consisting of a billboard (front looking image) and 2 separately designed labels.

I don’t think that managing the movement of several components of the same entity is a good idea.
In addition, I need to manipulate billboard quite often.

I was looking for a more natural solution that will enable me to be flexible with the design of the entities.

I’ve encountered a solution that mimics entities in an overlayed HTML elements.

Do you have your 5 cents about this solution?
It works good so far.

I agree that it would be useful to have this built-in to the CesiumJS library. I opened this feature request on GitHub for it: Ability to position entities relative to another entity · Issue #9095 · CesiumGS/cesium · GitHub.

In the meantime, if you’re able to group all of your elements into an HTML element that can then follow the 3D position in the scene like in this example: Cesium Sandcastle. Then this would be a good solution. The only issue is that since the HTML is “above” the canvas, it will never be obscured behind any of the 3D elements (such as when the point is behind a mountain) if that behavior is desired.