polyline / label scale on zoom

I have followed the Sandcastle Custom DataSource example loading data from a json datasource. I have polylines with labels. Is it possible to change the height and label position on zoom in. If i zoom too far it goes past the line top position and the labe (z)l. Is it easy to change height (z) of both the polyline and the label as I zoom into the globe?


Hi there,

You can attach a callback to your label position like this:


position : Cesium.Cartesian3.fromDegrees(-75.1641667, 39.9522222),

label : {

position : new Cesium.CallbackProperty(function() {

return // some new position based on camera height;

}, false),



Hope that helps!

  • Rachel