I am following the examples here:
Cesium and milsymbol – Cesium - as I am using milsymbol
and also
https://sandcastle.cesium.com/?src=CZML%20Billboard%20and%20Label.html&label=CZML
I modified the pixelOffset in all kinds of ways to test it and the positioin of the billboard never changes. In the case of the milsymbol it is always placed to the left of the actual position.
It turns out that
const czml = {
id: feature.id,
position: {
cartographicDegrees: [-75,40,0],
},
billboard: {
image: sym.asCanvas(),
pixelOffset: {
cartesian2: [sym.getAnchor().x, 0],
},
horizontalOrigin: HorizontalOrigin.LEFT,
verticalOrigin: VerticalOrigin.BOTTOM
},
};
czmlDatasource.process(czml);
is differert from:
viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-75, 40),
billboard : {
image : sym.asCanvas(),
pixelOffset : new .Cartesian2(-sym.markerAnchor.x, -sym.markerAnchor.y),
horizontalOrigin : HorizontalOrigin.LEFT, // default
verticalOrigin : VerticalOrigin.BOTTOM
}
});