1. A concise explanation of the problem you’re experiencing.
An HTML popup gets initial billboard position, but does not get elevation position, so the popup does not match position of billboard as new elevation is downloaded with updated tiles.
Is there a way to update this HTML overlay with changes in elevation ?
or
Is there a better way to do this ?
Example site: https://dev.globaltimoto.com/
Initially the popup appears to be in the correct position as above.
After zooming in and dragging/rotating the scene the popup begins to drift from the billboard, presumably because the billboard has updated it’s elevation.
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
This is the method used to get the position for the HTML overlay:
var canvasPosition = viewer.scene.cartesianToCanvasCoordinates( Cesium.Cartesian3.fromDegrees( position.lng, position.lat ) );
if ( Cesium.defined( canvasPosition ) ) {
$overlay.css( 'top', canvasPosition.y + 'px' );
$overlay.css( 'left', canvasPosition.x + 'px' );
}
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I need this because an HTML popup can include the styling and scroll bars for vertical overflow where needed, and is best associated with the map content by being locked to the billboard.
4. The Cesium version you’re using, your operating system and browser.
Cesium 1.51, Windows, macOS, iOS, FF, Chrome, Safari