It's possible to set the CallbackProperty to a bool variable? ?

1. A concise explanation of the problem you’re experiencing.

Currently, I need to create lots of polygons and set the default “show” to false. When certain conditions met, the “show” could change to true. I understand how to use Callback property to set dynamic positions, but I am not sure if it works for bool. I don’t know if there other way to achieve this. Thanks for helping me.

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

var tf = new Cesium.CallbackProperty(function(){

if (value>10)

return true;

}

else

return false;

}, false);

let entity_example=new Cesium.Entity();

entity_example.polygon={

hierarchy: new Cesium.PolygonHierarchy(poss),

material: Cesium.Color.RED.withAlpha(0.5),

heightReference : Cesium.HeightReference.CLAMP_TO_GROUND,

show: tf

}

``

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I need to control entity visibility dynamically after I create the entity.

4. The Cesium version you’re using, your operating system and browser.

Windows, Chrome

I think you should be able to just set show = true/false as needed.

So if you need to do it based on polling some condition like that, you could check every frame for it. Does that work?

Thanks! Nothing changes when I try to track the bool value. I decide to use callback property for position to control show/hide.

Thanks! Nothing changes when I try to track the bool value. I decide to use callback property for position to control show/hide.