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.