学习Cesium第一天Cesium Viewer配置参数

创建Cesium Viewer并配置参数

    const viewer= new Cesium.Viewer('mycesium',{
        animation:false,//动画小组件,即左下角的仪表,默认为true
        baseLayerPicker:true,//是否显示图层选择器,默认为true
        fullscreenButton:true,//是否显示全屏按钮,默认为true
        geocoder:true,//是否显示Geocoder(右上角的查询按钮),默认为true
        homeButton:true,//上是否显示Home按钮
        infoBox:false,//是否显示信息框
        sceneModelPicker:true,//是否显示三位地球/二维地图选择器
        selectionIndicator:false,//是否显示选取指示器(鼠标点击显示绿框)
        timeline:false,//时间轴
        navigationHelpButton:true,//是否显示右上角的帮助按钮
        scene3DOnly:true,//如果设置为true,则所有几何图形以三维模式绘制以节约GPU资源,默认为false
        clock:new Cesium.Clock(),//用于控制当前时间的时钟对象
        imageryProvider:new Cesium.OpenStreetMapImageryProvider({
            url:''
        }),//设置底图图层,尽在baseLayerPicker属性设置为flase时有意义
        terrainProvider:new Cesium.EllipsoidTerrainProvider(),//设置地形图层,仅在baseLayerPicker设置为false时有意义
        skyBox:new Cesium.skyBox({
            sources:{
                positiveX:'Cesium-1.7.1/Skybox/px.jpg',
                negativeX:'Cesium-1.7.1/Skybox/mx.jpg',
                positiveY:'Cesium-1.7.1/Skybox/py.jpg',
                negativeY:'Cesium-1.7.1/Skybox/my.jpg',
                positiveZ:'Cesium-1.7.1/Skybox/pz.jpg',
                negativeZ:'Cesium-1.7.1/Skybox/mz.jpg',

            }
        }),//用于渲染星空的SkyBox对象
        fullscreenElement:document.body,//全屏时渲染的html元素
        useDefaultRenderLoop:true,//如果需要控制渲染循环,则设置为true
        targetFrameRate:undefined,//使用默认render loop时的帧率
        showRenderLoopErrors:false,//如果设置为true,将显示错误信息
        automaticallyTrackDataSourceClocks:true,//自动追踪最近添加的数据源式中设置
        contextOptions:undefined,//传递给Scene对象的上下文参数(scene.options)
        sceneMode:Cesium.sceneMode.SCENE3D,//初始化场景模式
        mapProjection:new Cesium.WebMercatorProjection(),//地图投影体系
        dataScurces:new Cesium.DataSourceCollection()//需要进行可视化的数据源集合
    });
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值