I’m trying to show/hide entities using Cesium.CallbackProperty
. My code is below:
viewer.entities.add({
id,
position: position,
image: image,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
width: size,
height: size,
pixelOffset: Cesium.Cartesian2.fromElements(0, 0),
heightReference: Cesium.HeightReference.NONE,
eyeOffset: new Cesium.Cartesian3(0.0, 0.0, -1.0),
show: new Cesium.CallbackProperty(toggleCallback, true),
})
The callback code is just simple for a test:
function toggleCallback() {
return false
}
Now, whether I return true or false, the entity still shows.
Is Cesium.CallbackProperty
perhaps not available on the show
property?
What is a strategy for doing this? I imagine it’s quite a common use-case. I’m trying to hide/show an entity based on the position of the timeline.