scaleByDistance for box / ellipse entities

Hello all,

Is there any way for an entity to keep it’s size relative to zoom level, similar to how points / labels have a scaleByDistance property? I currently have a funky workaround that uses CompositeProperties on camera.moveEnd. This tanks performance when there are a significant number of entities on the map (around 50 or so on my Intel HD 4400) and doesn’t look good if the user keeps moving around enough to avoid triggering moveEnd. Specifically, these are box / ellipse style entities if that helps.

Any advice is appreciated! If you need more information, please let me know.

Hi David,

I would suggest you use a glTF to achieve this effect, since Cesium models support minimum pixel size.

var entity = viewer.entities.add({

name : url,

position : position,

orientation : orientation,

model : {

uri : url,

minimumPixelSize : 128




You can see in the example below:


  • Rachel

Thanks for the advice Rachel!

One followup question - is it possible to scale the dimensions of a glTF model using a transform? I’m trying to construct something like a 3D bar chart with varying heights at different locations depending on the data. I’d like the bars to have varying heights and the ellipses to have variable radii. Do you think it’s possible to do something like this with the glTF approach?

Hello David,

We currently have support for applying a uniform scale to models, but not a non-uniform scale. We have an issue written up on GitHub here to add it:

I added a link to your forum post so we can give you an update. If you would like to take a stab at adding this feature, we would be happy to look at a pull request! I can point you to the pieces of code that would need to be updated.



I’d love to take a shot at it! If you give me a nudge in the right direction, I’ll work on creating a PR for #2922.