billboardcollection / labelscollection uniform color / appearance

I need to change the color of many labels. they all have the same color and the color change rate is high.

is there an option to set a lablecollection or a billboardcollection with a uniform appearance for all of its labels / billboards? - just like geometry instances can have a uniform appearance with "appearance" in a primitive?

It's much more efficient to change the appearance once, than to go through all of the objects in a collection.

alternativly, is there a way to set a geometry with a fixed screen size (so its size wont change when I'm zooming)?

Thank you!


As of now, the answer is no to both questions unless you write a custom geometry and custom appearance, which would basically allow you to implement an optimized billboard/label.

How many billboards/labels do you have? Setting the property individually may not be as bad as we would think.


I tried to change lablescollection. I added uniforomcolor property and modified its update function and made it call rebindAllGlyphs on all labels in its collection when uniformcolor is set to a new color. I also modified rebindAllGlyphs to use my uniformcolor property instead of the fillcolor property of each label when calling createGlyphCanvas. It works the first time I set uniformcolor for the labelcollection. after that, the color of the already shown labels doesnt change. Any ideas?

Uniforms are accessed through a uniform map that that is usually defined in the constructor function. The uniform map contains functions that usually reach into properties of the parent object that are closed over, so verify that the function is returning the new value you expect. For a simple example, see here.


Hi Patrick,
You mentioned that changing the color individually may not be so bad here. I'm currently trying to work with 100,000 billboards. Do you think changing individually may not be that bad? All the changes can occur at once so that only one update function would be called afterwards, if that matters...

I tried adding it myself and opened a pull request.
Here it is if someone is interested.