Bug: selection of clamped billboard is off-location after changing dimension

To reproduce, paste the following into a sandcastle and click Run:

var viewer = new Cesium.Viewer(‘cesiumContainer’);

var bb;

function home() {

Sandcastle.declare(home);

viewer.camera.flyHome(0);

viewer.entities.removeAll();

}

function addClampedBillboard() {

Sandcastle.declare(addClampedBillboard);

bb = viewer.entities.add({

position : Cesium.Cartesian3.fromDegrees(-71.4001, 41.8204),

billboard :{

image : ‘…/images/Cesium_Logo_overlay.png’,

verticalOrigin: Cesium.VerticalOrigin.BOTTOM,

heightReference: Cesium.HeightReference.CLAMP_TO_GROUND

}

});

}

function addUnclampedBillboard() {

Sandcastle.declare(addUnclampedBillboard);

bb = viewer.entities.add({

position : Cesium.Cartesian3.fromDegrees(-71.4001, 41.8204),

billboard :{

image : ‘…/images/Cesium_Logo_overlay.png’,

verticalOrigin: Cesium.VerticalOrigin.BOTTOM

}

});

}

Sandcastle.addToolbarMenu([{

text : ‘Home’,

onselect : function() {

home();

Sandcastle.highlight(home);

}

},{

text : ‘Add clamped billboard’,

onselect : function() {

addClampedBillboard();

Sandcastle.highlight(addClampedBillboard);

}

}, {

text : ‘Add unclamped billboard’,

onselect : function() {

addUnclampedBillboard();

Sandcastle.highlight(addUnclampedBillboard);

}

}]);

Select “Add clamped billboard”. Now use dimension picker to choose 2D map. Now click on the billboard and the green selection indicator is halfway across the country.

If you add a billboard that has heightReference set to Cesium.HeightReference.CLAMP_TO_GROUND, change the dimension from 3D to 2D, then select the billboard, the selection indicator appears in the wrong location.

Thanks for reporting – this is actually a known problem with an open issue. I’ll mention this post so that you can be notified if we make any progress on it.

https://github.com/AnalyticalGraphicsInc/cesium/issues/5042

  • Rachel

Thanks Rachel! It’s good to see this is already a known issue.