Let BillboardCollection and LabelCollection inherit position from entity its in

I’m trying to get around the problem where TextureAtlas would overflow if I make a dynamic label with a svg where I have text elements constantly changing.

My idea was to use and entity as a label, with a BillboardCollection for the background and a LabelCollection for the text. But I’m realising that the Collections are not really part of the entity I put them in which I guess makes sense somehow.

Is there a way to make the billboardCollection and LabelCollection that is part of an entity to have inherit the position of the entity if no separate position is specified?

If this doesn’t work, do I need to place each graphical element and text into separate entities?

What is the best praxis for a dynamic label with a background of my choice that is expected to be updated very very very very much time more than one label without killing Cesium because of an overflow in the TextureAtlas?

Hello,

I’m sorry, I don’t quite understand the problem you’re having. Can you paste a code sample?

There isn’t a way to make a billboard or label collection part of an entity. Maybe I can help you find an alternate solution.

Best,

Hannah

Thanks Hannah, that would be nice.

I would like to have a dynamic label with a custom background. The will be 1 - 500 of these labels, all with dynamic content that updates on any tick in the timeline. I have been able to make this with svg’s but then ran out of memory du to the limitation of the TextureAtlas. I have asked about this before: https://cesiumjs.org/forum.html#!msg/cesium-dev/tuQyixSKJuA/3-jsFmIABwAJ

I have read somewhere that the text in labels how ever is being reused, so I thought that I should be able to use this to have dynamic labels without having the TextureAtlas issue again.

So in this case “Label” is a mix of Labels and Billboards.

Here is a test I made which shows an idea of what the label might look like. https://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=ddaa810a309a362551e90b63a67a6a2c where the number will be updated constantly. Plus up to three more rows of text that will be updated.

These “Labels” will be right next to an entity with a billboard which will be moving around constantly. As the label and the moving entity belong together I thought it would be nice to only have to specify one position. This however seems to be impossible.

So do you think would be the best way to achieve something like this? Treat everything as separate objects?

Thanks for the example, that makes a lot more sense.
Yes, using a label should be better because it re-uses letters in the texture atlas for each label.

Entity labels work the same way. Is there a reason you can’t add a label using the Entity API?

Example: https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Labels.html&label=Showcases

-Hannah

Not more than that I want a background for the label. But I think it will mean that I need a billboard behind the label, right?

Right. In that case, I think something like this should work:

var viewer = new Cesium.Viewer(‘cesiumContainer’);

viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
billboard :{
image : ‘…/images/checkerboard.png’,
color: Cesium.Color.WHITE.withAlpha(0.3)
},
label: {
text: ‘my text’,
eyeOffset: new Cesium.Cartesian3(0, 0, -3)
}
});

``

-Hannah