Line from PixelOffset to Billboard-Position

Hi,

I would like to draw a line from the billboard-position to the symbol, which is drawn at a pixel-offset depending on scale.

For example, in the Cesium documentation: I would like to draw a line from the yellow point to the middle of the symbol.

Could anyone help ?

Rüdiger

Billboard primitives, added using a billboard collection, have the “computeScreenSpacePosition” method.
That can be used to then pick a coordinate, and move one side of the line to that.

const ssp = billboard.computeScreenSpacePosition(viewer.scene);
const ray = viewer.camera.getPickRay(ssp);
// This should be the desired point ↓
const cartesian = this.v.scene.globe.pick(ray, viewer.scene);

You’ll probably need to update it every frame, using a SampleProperty, to keep the line connected to the billboard.

Hi Max,

thank you for the response - but I don’t know if it could help me.

In the moment I draw a polyline to the world-coordinates of the billboard.

Regards Rüdiger