cesium基础组件的显示与隐藏

方法一

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* 通过css控制组件显隐及位置 */
        .cesium-viewer-toolbar,   /*右上角按钮*/
        .cesium-viewer-animationContainer,/*左下角动画控件*/
        .cesium-viewer-timelineContainer,/*时间线*/
        .cesium-viewer-bottom /*logo信息*/
        {
            display: none;
        }
        /* 隐藏logo图片 */
        .cesium-widget-credits {
            display: none;
        }
        .cesium-viewer-fullscreenContainer { /* 全屏按钮*/
            display: none !important;
        }

  

 
方法二
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const viewer = new Cesium.Viewer('container',{
           // animation:false,//动画小组件
           // baseLayerPicker:false,//地图组件,请选择三维数字地球的底图(image and terrain)
           // fullscreenButton:false,//全屏组件
           // vrButton:false, // VR模式
           // geocoder:false,//地理编码搜索组件
           // homeButton:false,//首页 点击之后视图将跳转到默认视角
           // infoBox:false,//信息框
           // sceneModePicker:false,//场景模式 切换2D 3D和 Columbus View(cv)模式
           // selectionIndicator:false,//是否显示选取指示组件
           // navigationHelpButton:false,//帮助提示,如何操作数字地球
           // // 如果最初应该看到导航说明,则为true,如果直到用户明确单击该按钮,则该按钮提示不显示,否则为true
           // navigationInstructionsInitiallyVisible:false,
           // skyBox:new Cesium.SkyBox({
           //     mapProjection:new Cesium.WebMercatorProjection(),
           // }),//天空盒效果
           // timeline:false,//时间轴
       })
       //隐藏左下角logo
       // viewer._cesiumWidget._creditContainer.style.display ='none'

  

posted @   菜鸟程序员的总结  阅读(726)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
点击右上角即可分享
微信分享提示