zoukankan      html  css  js  c++  java
  • Cesium的api之关于viewer

    1、viewer是用来构建三维的主要的部件;通过创建viewer可以完成三维的图片、地形的展示等

    2、属性

     * @param {Element|String} container :指定的是在html页面存放viewer的html标签或者标签对应的ID

    * @param {Object} [options] Object with the following properties:
    * @param {Boolean} [options.animation=true] 如果该值为true,则会创建动画显示部件;若是为false,则不会创建动画显示部件.
    * @param {Boolean} [options.baseLayerPicker=true] 如果该值设置为true,则会创建baselayerpicker(该部件关联一个panel用于管理image和terrain的);

                                                                               若是为false     则不会创建.
    * @param {Boolean} [options.fullscreenButton=true]  如果该值为true,则在页面创建全屏显示部件;若是为false则不会创建
    * @param {Boolean} [options.geocoder=true] 如果该值为true,则创建地图编码器;否则则不会创建.
    * @param {Boolean} [options.homeButton=true] 如果该值为true,则创建该部件;否则不创建
    * @param {Boolean} [options.infoBox=true]如果该值为false,则不创建信息查询框部件;否则创建
    * @param {Boolean} [options.sceneModePicker=true] 如果该值为true,则创建场景模式部件;否则不创建
    * @param {Boolean} [options.selectionIndicator=true] 如果该值为true,则创建;否则不创
    * @param {Boolean} [options.timeline=true]设置为true,则viewer中显示时间轴线;否则隐藏
    * @param {Boolean} [options.navigationHelpButton=true] 设置为true,则viewer中显示帮助按钮;否则隐藏
    * @param {Boolean} [options.navigationInstructionsInitiallyVisible=true] True if the navigation instructions should initially be visible, or false if the should not be shown until the user explicitly clicks the button.
    * @param {Boolean} [options.scene3DOnly=false] 该值为true;绘制的内容保存显卡中
    * @param {Clock} [options.clock=new Clock()] viewer中的clock显示当前的系统时间
    * @param {ProviderViewModel} [options.selectedImageryProviderViewModel] 指定当前imagery layer, 如若没有设定该值则默认设置image player集合中的第一个;使用该属性的前提baseLayerPicker设置为true(设置三维瓦片的)
    * @param {ProviderViewModel[]} [options.imageryProviderViewModels=createDefaultImageryProviderViewModels()]只有当baseLayerPicker设置为true;该参数方可使用;从指定的imagery provider提供
    * @param {ProviderViewModel} [options.selectedTerrainProviderViewModel] .指定当前terrain layer, 如若没有设定该值则默认设置terrain player集合中的第一个;使用该属性的前提baseLayerPicker设置为true(设置地形的)
    * @param {ProviderViewModel[]} [options.terrainProviderViewModels=createDefaultTerrainProviderViewModels()] 只有当baseLayerPicker设置为true;该参数方可使用;从指定的terrain provider提供

    * @param {ImageryProvider} [options.imageryProvider=new BingMapsImageryProvider()] 只要当baselayerpicker设为false该值方可使用默认使用bing地图服务

    * @param {TerrainProvider} [options.terrainProvider=new EllipsoidTerrainProvider()] 椭球地形服务
    * @param {SkyBox} [options.skyBox]该值用来渲染星星的 若是为undefined的则会使用默认的方式显示星星
    * @param {Element} [options.fullscreenElement=document.body]  当点击fullscreenbutton的时候全屏显示的
    * @param {Boolean} [options.useDefaultRenderLoop=true] 该值为true用来控制三维循环渲染的.否则则不能
    * @param {Number} [options.targetFrameRate] 目标渲染的速度
    * @param {Boolean} [options.showRenderLoopErrors=true] 该值为true时 则会生成一个panel用来展示渲染过程出现的错误
    * @param {Boolean} [options.automaticallyTrackDataSourceClocks=true] 该值为true则会自动根据最新的时间来更新数据或者升级数据
    * @param {Object} [options.contextOptions] 
    * @param {SceneMode} [options.sceneMode=SceneMode.SCENE3D] 初始最初的三维场景
    * @param {MapProjection} [options.mapProjection=new GeographicProjection()] 地图投影方式的设定(2d和哥伦布)
    * @param {Boolean} [options.orderIndependentTranslucency=true] .该值设为true,并且能够被支持;则会以半透明的方式显示
    * @param {Element|String} [options.creditContainer] 根据标签元素或者ID创建容器; 如若没有指定 则默认自动在部件的底部创建
    * @param {DataSourceCollection} [options.dataSources=new DataSourceCollection()] 该可视化部件的数据源集合;若是提供了该参数会当做被自身所拥有,则当viewer被销毁时,则该可视化部件不会被销毁
    *

    3、使用如下:

    var viewer = new Cesium.Viewer('cesiumContainer',{

    animation:false, //动画控制不显示

    baseLayerPicker:true,//图层控制显示

    geocoder:false,//地名查找不显示

    timeline:false,//时间线不显示

    sceneModePicker:true//投影方式显示

    });

    4、api地址

    http://cesiumjs.org/refdoc.html

  • 相关阅读:
    poj 2312 Battle City
    poj 2002 Squares
    poj 3641 Pseudoprime numbers
    poj 3580 SuperMemo
    poj 3281 Dining
    poj 3259 Wormholes
    poj 3080 Blue Jeans
    poj 3070 Fibonacci
    poj 2887 Big String
    poj 2631 Roads in the North
  • 原文地址:https://www.cnblogs.com/dalan/p/4150175.html
Copyright © 2011-2022 走看看