Label Width or Text inside billboard

Hi,

In relation to this issue:
https://groups.google.com/d/topic/cesium-dev/HMbS7CuTkLw/discussion

How can the width of a label be taken?

Billboards have a width that can be set.

The goal is to be able to have a label with a background, via a Billboard or Rectangle, but give it a width based on the label’s width.

Also aware of this feature being which will allow a balloon for a label: https://github.com/AnalyticalGraphicsInc/cesium/issues/954

Any ideas on how can we achieve the same?

Thank you.

As a first hint - The width of a label can be measured by adding up the glyphs inside it (ie. label._glyphs[n].dimensions.width)

This can give us a width for a label and create a billboard behind it which is the same width.