方法1 (推荐)
<body> <div id="cesiumContainer"></div> <script> var viewer = new Cesium.Viewer('cesiumContainer'); viewer.animation.container.style.display ='none';//隐藏动画控件 viewer.timeline.container.style.display ='none';//隐藏时间线控件 viewer.geocoder.container.style.display ='none';//隐藏地名查找控件 viewer.cesiumWidget.creditContainer.style.display ='none';//隐藏ceisum标识 </script> </body>
方法2(在viewer的构造函数中设置参数进行控件隐藏,不够灵活)
var viewer = new Cesium.Viewer('cesiumContainer', { scene3DOnly: true, selectionIndicator: false, baseLayerPicker: false });