DistanceDisplayCondition callback?

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

I have a few different entities which have defined two different display graphics(billboard and model, or billboard and polyline). I’d like to flip the display from the billboard to the model/polyline when the camera is near or far to the entity. Is there something to do this that I’ve missed? The DistanceDisplayCondition offers something similar but that is defined in the billboard not at the entity, and there’s no callback to do anything custom.

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


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


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

Cesium 1.41, Windows 10, Chrome Version 63.0.3239.132 (Official Build) (64-bit)

HI Scott.

Would it be possible to use a callback property for the show property on the billboard, model, ans polylines? In the callback, you would need to use the distance between the camera position and the entity position.



Yea that would work. Would that be more efficient than tracking the entity’s distance to the camera in the pre-render frame event? Currently, I’m tracking the distance in the pre render event with the calculated squared distance(camera<->entity) to avoid using Math.sqrt. I haven’t looked into the how the DistanceDisplayCondition works, but I could propagate the event if there was a callback. Clearly there is some code that flips a property when that far-near is breached. I just want a callback as apposed to flipping any property changing.

I think using the callbackProperty will be the most efficient in terms of making sure that when the entity updates, the entities not shown will not evaluate all the appearance based properties. DistanceDisplayCondition encapsulates a min and max value, so there’s no callback.