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.
You cannot directly add a DOM element in Canvas3D Cesium . BUT there are 2 ways:
- 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)
- 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.
pinBuilder palette sample
Have a nice day
thank you very much!