1. A concise explanation of the problem you're experiencing.
When clicking on an entity, the infoBox opens with the associated description. Since my descriptions would be heavy to pre-load, I set the description to a spinner, and asynchronously load the new description.
When updating the description, the infoBox is not resized, making it difficult to read the contents. Closing it and opening it again does a resize (I don't re-load contents that have previously been loaded).
I'd like to trigger the resize event when updating the entity's description.
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
I'm not sure whether this is a bug or a call I'm not making, but I could not find answers to this question in the infoBox documentation.
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
User experience would be better with a size that's adapted to the contents.
4. The Cesium version you're using, your operating system and browser.
How are you updating the description? The InfoBox should automatically recalculate the height whenever the value of the ‘description’ property of the viewmodel changes:
I can’t seem to recreate this behavior. Here’s a sandcastle example. If you click on the plane you should see a short description, and after 10 seconds it should update. When you run that, does it correctly update the height for the new text?
The sandcastle example works. I investigated a bit more, and it seems that the problem is related to pictures, which are not fully loaded in my case.
- With text content only, the infoBox resizes correctly.
- When the content is just an HTML <img /> tag, the box is very small, then the picture loads and the box does not resize.
I'll try computing the picture size and infer the values in the width and height tag attributes and see if this is helping set the proper inner size.
I haven't tried that but solved the problem by computing the picture size server-side and inferring the width and height attributes into the <img /> tag.
Thanks for your support!