Add a div element on Cesium by position?

Can I use latitude and lontitude position to add a div element on Cesium?

Maybe I can only use cartesianToCanvasCoordinates to transform the position to canvas coordinates.

hello @translate,
You cannot directly add a DOM element in Canvas3D Cesium . BUT there are 2 ways:

  1. use custom Cesium labels ( see new Cesium.PinBuilder() ). (they are eventually assembled as HTML5 elements that are rendered into an image through a separate unvisible canvas2d and then used as a texture for PinBuilder in a 3d canvas)
  2. we can get the coordinates of a point from the 3d world in the 2d canvas and if the handler regularly tracks them and applies them to the absolute position, then the div element placed in the layer above will track the point in the 3d world.
    I had to do both options and they work great. For most questions, if they arise, the Cesium documentation and sandbox examples will suffice.

pinBuilderSample in3d
pinBuilder palette sample

HTML Overlay

Have a nice day


thank you very much!

1 Like