Why isn't the billboard origin the same using heightReference

When I run this code in the sandcastle, the billboards are not in the same place?

Sandcastle.declare(addBillboard);

    var scene = viewer.scene;
    var billBoardCollection1 = scene.primitives.add(
        new Cesium.BillboardCollection({scene: scene}));
    
//This billboard is not centered vertically (vertical origin has no effect really)
    billBoardCollection1.add({
        position : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
        image: '../images/facility.gif',
        verticalOrigin: Cesium.VerticalOrigin.CENTER,
        heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
    });
    
    //this original example is centered in vertically
    viewer.entities.add({
        position : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
        billboard :{
            image : '../images/facility.gif'
        }
    });

HeightReference is required to clamp billboards to ground when using terrain.
Passing a scene to the billboard collection is required for heightReference.

What do I need to do get the billboard's origin vertically centered?

Also I noticed when the billboards are at the edge (far left or right) they appear in different positions relative to each other. The non centered billboard from the collection changes position.

Thanks

Hello,

This looks like a bug. I’ve submitted an issue here: https://github.com/AnalyticalGraphicsInc/cesium/issues/3452

Best,

Hannah

Hello,

I just wanted to follow up and say this issue appears to be fixed. If you are still experiencing a problem, let me know. Thanks!

-Hannah

1 Like