Add a toggle button to viewer

To clarify, I want to overlay a button on top of the viewer like is in the sandcastle example. When I do it like this, it positions the button above the viewer.

toolbarLeftClass: {

display: “block”,

position: “absolute”,

top: “5px”,

left: “5px”


cesiumContainerId: {

position: “relative”,

width: “100%”,

height: “100%”,

margin: “0”,

padding: “0”,

overflow: “hidden”


this.cesiumContainer = element}>

Click me!

There’s nothing special you need to do to make it work for CesiumJS. This is a more general HTML/CSS issue. So you can find some good resources if you look up how to position a button on top of a canvas more generally, like this answer: