cesium viewer layout question

Hi, Firstly I’d like to thank the developers for making such an amazing tool, mind blowing really. I’m pretty new to js so apologies for the noobish question.

I am attempting to use the cesium viewer to give me the button on screen that allows me to select different basemaps, however the widget button does not appear as in the examples, the different basemaps are listed below in a long line. In fact any of the options that I set to true just appear under the globe canvas…

Could someone please explain how to have the widget appear as an on screen button as in the examples? I am also wondering if it is possible to force a different basemap to be loaded as the default when the page loads?

Thanks in advance for any help you can give me, here is my jsfiddle sofar - http://jsfiddle.net/ageojones/tdU2k/

You need to import widgets.css into your application so that the widgets have access to their style information. In your jsfiddle, this is fixed by simply adding “http://cesiumjs.org/Cesium/Build/CesiumUnminified/Widgets/widgets.css” as an external resource. Normally, you would just include a link similar to the below in your HTML head section.

For your second question, simply pass selectedImageryProviderViewModel as one of the options properties to the Viewer. It should be an instance of the ImageryProiderViewModel you want to use. I don’t have an example handy, but if you have any trouble, just let me know and I’ll post something.

Hope that helps,


Thank you so much, got the widget working. Still need to play with the default imagery. I’m going to be spending a lot of time using cesium, hope to help out the dev team once my skills have improved. I see so much potential in this project, specifically for a pet project of mine that could potentially save lives. Thanks again for all your hard work.