<body>
<div id="button">
<script>
var myButton = document.createElement("input");
myButton.type = "button";
myButton.value = "Click here";
document.getElementById("button").appendChild(myButton);
</script>
</div>
<div id="cesiumContainer"></div>
<script>
var cesiumWidget = new Cesium.CesiumWidget('cesiumContainer');
</script>
</body>
The problem is that, without fail, the CesiumWidget appears on top of the button. I can tell because if I comment out the line creating the CesiumWidget, the button is right there. Even if I try 'myButton.style.zIndex=9999', it's still hidden. So, is there some way in Cesium for adding arbitrary elements to the interface? Or is there a way to make the JavaScript button overlay the Cesium widget? I've tried the documentation and tutorials and haven't found anything to help me here.
--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
When I comment out the JavaScript that makes the CesiumWidget, the button appears at the top-left of the screen; it's being overlaid by the widget somehow, but it's still there. I did try changing the cesiumContainer's style as suggested, but that didn't work either.
Alas, moving the cesiumContainer div didn't work.
When I comment out the JavaScript that makes the CesiumWidget, the button appears at the top-left of the screen; it's being overlaid by the widget somehow, but it's still there. I did try changing the cesiumContainer's style as suggested, but that didn't work either.
I set the cesiumContainer's style to position:relative and z-index:0. Then the button to position:absolute and z-index:1. And now the button is floating on top of the Cesium interface, just as planned.
Thanks for helping me figure this out.