<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="https://cesiumjs.org/releases/1.58/Build/Cesium/Cesium.js"></script>
<link href="https://cesiumjs.org/releases/1.58/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
</head>
<body>
<div id="cesiumContainer" style="width: 700px; height:400px"></div>
<script>
Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI4ZTU4ZThkYy01NTg1LTRhZjYtOGQ3Ny0'+
'3MTVlMTI4MzA5NjkiLCJpZCI6MTE4MjEsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1NTk4MDI0MDB9.FqelmTx7OeJdCLJ_b-PxdZSrSeC0Fd4cA1_os4RctVg';
var viewer = new Cesium.Viewer('cesiumContainer');
</script>
</body>
</html>

Cesium.Viewer 用于构建应用程序的基本小部件 它将所有标准Cesium小部件组合成一个可重用的包。 可以使用mixin来扩展窗口小部件,这可以添加对各种应用程序有用的功能。

Name Type Description
container Element| String The DOM element or ID that will contain the widget.
options Object Object with the following properties:

Name Type Default Description
animation Boolean true If set to false, the Animation widget will not be created.  // 如果设置为false,则不会创建“动画”窗口小部件。
baseLayerPicker Boolean true If set to false, the BaseLayerPicker widget will not be created. // 如果设置为false,则不会创建BaseLayerPicker小部件。
fullscreenButton Boolean true If set to false, the FullscreenButton widget will not be created. //  如果设置为false,则不会创建FullscreenButton小部件。
vrButton Boolean false If set to true, the VRButton widget will be created.  // 如果设置为true,则将创建VRButton小部件。
geocoder Boolean | Array.<GeocoderService> true If set to false, the Geocoder widget will not be created. // 如果设置为false,则不会创建Geocoder小部件
homeButton Boolean true If set to false, the HomeButton widget will not be created. // 如果设置为false,则不会创建“主页按钮”窗口小部件。
infoBox Boolean true If set to false, the InfoBox widget will not be created. // 如果设置为false,则不会创建InfoBox小部件。
sceneModePicker Boolean true If set to false, the SceneModePicker widget will not be created. // 如果设置为false,则不会创建SceneModePicker小部件。
selectionIndicator Boolean true If set to false, the SelectionIndicator widget will not be created. // 如果设置为false,则不会创建SelectionIndicator小部件。
timeline Boolean true If set to false, the Timeline widget will not be created. // 如果设置为false,则不会创建时间轴窗口小部件。
navigationHelpButton Boolean true If set to false, the navigation help button will not be created. //如果设置为false,则不会创建导航帮助按钮。
navigationInstructionsInitiallyVisible Boolean 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.

// 如果导航说明最初应该可见,则为True;如果在用户明确单击按钮之前不应显示导航说明,则为false。

scene3DOnly Boolean false

When true, each geometry instance will only be rendered in 3D to save GPU memory.

// 如果为true,则每个几何实例仅以3D呈现以节省GPU内存。

shouldAnimate Boolean false

true if the clock should attempt to advance simulation time by default, false otherwise. This option takes precedence over setting Viewer#clockViewModel.

// 如果时钟默认情况下应尝试提前模拟时间,则为true,否则为false。 此选项优先于设置Viewer#clockViewModel。

clockViewModel ClockViewModel new ClockViewModel(options.clock) The clock view model to use to control current time. // 用于控制当前时间的时钟视图模型。
selectedImageryProviderViewModel ProviderViewModel  

The view model for the current base imagery layer, if not supplied the first available base layer is used. This value is only valid if options.baseLayerPicker is set to true.

// 如果未提供第一个可用基础层,则使用当前基础图像层的视图模型。 仅当options.baseLayerPicker设置为true时,此值才有效。

imageryProviderViewModels Array.<ProviderViewModel> createDefaultImageryProviderViewModels()

The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if options.baseLayerPicker is set to true.

// 可从BaseLayerPicker中选择的ProviderViewModel数组。 仅当options.baseLayerPicker设置为true时,此值才有效。

selectedTerrainProviderViewModel ProviderViewModel  

The view model for the current base terrain layer, if not supplied the first available base layer is used. This value is only valid if options.baseLayerPicker is set to true.

// 如果未提供第一个可用基础层,则使用当前基础地形图层的视图模型。 仅当options.baseLayerPicker设置为true时,此值才有效

terrainProviderViewModels Array.<ProviderViewModel> createDefaultTerrainProviderViewModels()

The array of ProviderViewModels to be selectable from the BaseLayerPicker. This value is only valid if options.baseLayerPicker is set to true.

//可从BaseLayerPicker中选择的ProviderViewModel数组。 仅当options.baseLayerPicker设置为true时,此值才有效。

imageryProvider ImageryProvider createWorldImagery()

The imagery provider to use. This value is only valid if options.baseLayerPicker is set to false.

// 要使用的图像提供程序。 仅当options.baseLayerPicker设置为false时,此值才有效。

terrainProvider TerrainProvider new EllipsoidTerrainProvider()

The terrain provider to use

// 要使用的地形提供程序

skyBox SkyBox  

The skybox used to render the stars. When undefined, the default stars are used.

// 用于渲染星星的天空盒。 未定义时,使用默认星号。

skyAtmosphere SkyAtmosphere  

Blue sky, and the glow around the Earth's limb. Set to false to turn it off.

// 蔚蓝的天空,以及地球四肢的光芒。 设置为false以将其关闭。

fullscreenElement Element | String document.body

The element or id to be placed into fullscreen mode when the full screen button is pressed.

// 按下全屏按钮时要放入全屏模式的元素或ID。

useDefaultRenderLoop Boolean true

True if this widget should control the render loop, false otherwise.

// 如果此窗口小部件应控制渲染循环,则为True,否则为false。

targetFrameRate Number  

The target frame rate when using the default render loop.

// 使用默认渲染循环时的目标帧速率。

showRenderLoopErrors Boolean true

If true, this widget will automatically display an HTML panel to the user containing the error, if a render loop error occurs.

// 如果为true,则此窗口小部件将自动向包含错误的用户显示HTML面板(如果发生渲染循环错误)。

automaticallyTrackDataSourceClocks Boolean true

If true, this widget will automatically track the clock settings of newly added DataSources, updating if the DataSource's clock changes. Set this to false if you want to configure the clock independently.

// 如果为true,则此窗口小部件将自动跟踪新添加的DataSource的时钟设置,如果DataSource的时钟更改则更新。 如果要独立配置时钟,请将此项设置为false。

contextOptions Object  

Context and WebGL creation properties corresponding to options passed to Scene.

// 与传递给Scene的选项对应的Context和WebGL创建属性。

sceneMode SceneMode SceneMode.SCENE3D The initial scene mode. // 初始场景模式。
mapProjection MapProjection new GeographicProjection()

The map projection to use in 2D and Columbus View modes.

// 用于2D和Columbus View模式的地图投影。

globe Globe new Globe(mapProjection.ellipsoid)

The globe to use in the scene. If set to false, no globe will be added.

// 地球在场景中使用。 如果设置为false,则不会添加地球仪。

orderIndependentTranslucency Boolean true

If true and the configuration supports it, use order independent translucency.

// 如果为true且配置支持它,请使用与顺序无关的半透明度。

creditContainer Element | String  

The DOM element or ID that will contain the CreditDisplay. If not specified, the credits are added to the bottom of the widget itself.

// 包含CreditDisplay的DOM元素或ID。 如果未指定,则将积分添加到窗口小部件的底部。

creditViewport Element | String  

The DOM element or ID that will contain the credit pop up created by the CreditDisplay. If not specified, it will appear over the widget itself.

// 将包含CreditDisplay创建的信用弹出窗口的DOM元素或ID。 如果未指定,它将显示在窗口小部件本身上。

dataSources DataSourceCollection new DataSourceCollection()

The collection of data sources visualized by the widget. If this parameter is provided, the instance is assumed to be owned by the caller and will not be destroyed when the viewer is destroyed.

// 窗口小部件可视化的数据源集合。 如果提供了此参数,则假定实例由调用者拥有,并且在销毁查看器时不会销毁该实例。

terrainExaggeration Number 1.0

A scalar used to exaggerate the terrain. Note that terrain exaggeration will not modify any other primitive as they are positioned relative to the ellipsoid.

// 用于夸大地形的标量。 请注意,地形夸大不会修改任何其他基元,因为它们相对于椭球定位。

shadows Boolean false

Determines if shadows are cast by the sun.

// 确定是否由太阳投射阴影。

terrainShadows ShadowMode ShadowMode.RECEIVE_ONLY

Determines if the terrain casts or receives shadows from the sun.

// 确定地形是否投射或接收来自太阳的阴影。

mapMode2D MapMode2D MapMode2D.INFINITE_SCROLL

Determines if the 2D map is rotatable or can be scrolled infinitely in the horizontal direction.

// 确定2D地图是可旋转的还是可以在水平方向上无限滚动。

projectionPicker Boolean false

If set to true, the ProjectionPicker widget will be created.

// 如果设置为true,则将创建ProjectionPicker小部件。

requestRenderMode Boolean false

If true, rendering a frame will only occur when needed as determined by changes within the scene. Enabling reduces the CPU/GPU usage of your application and uses less battery on mobile, but requires using Scene#requestRender to render a new frame explicitly in this mode. This will be necessary in many cases after making changes to the scene in other parts of the API. See Improving Performance with Explicit Rendering.

// 如果为true,则仅在需要时才渲染帧,这由场景内的更改确定。 启用会降低应用程序的CPU / GPU使用率并减少移动设备上的电量,但需要使用Scene#requestRender在此模式下显式呈现新帧。 在API的其他部分中对场景进行更改后,在许多情况下这是必要的。 请参阅使用显式渲染提高性能。

maximumRenderTimeChange Number 0.0

If requestRenderMode is true, this value defines the maximum change in simulation time allowed before a render is requested. See Improving Performance with Explicit Rendering.

// 如果requestRenderMode为true,则此值定义在请求呈现之前允许的模拟时间的最大更改。 请参阅使用显式渲染提高性能。

Cesium.Viewer的更多相关文章

  1. Cesium入门4 - 创建Cesium Viewer

    Cesium入门4 - 创建Cesium Viewer Cesium中文网:http://cesiumcn.org/ | 国内快速访问:http://cesium.coinidea.com/ 任何Ce ...

  2. cesium核心类Viewer简介

    1.简单描述Viewer Viewer类是cesium的核心类,是地图可视化展示的主窗口,cesium程序应用的切入口,扮演必不可少的核心角色. 官网的英文解析如下: A base widget fo ...

  3. Cesium的api之关于viewer(二)

    1.构建一个viewer,如下创建:options的参数根据实际情况,进行设定 var viewer = new Cesium.Viewer('cesiumContainer', { //Start ...

  4. Cesium的api之关于viewer

    1.viewer是用来构建三维的主要的部件:通过创建viewer可以完成三维的图片.地形的展示等 2.属性 * @param {Element|String} container :指定的是在html ...

  5. cesium 之核心类 Viewer 简介篇

    前言 cesium 官网的api文档介绍地址cesium官网api,里面详细的介绍 cesium 各个类的介绍,还有就是在线例子:cesium 官网在线例子,这个也是学习 cesium 的好素材. 简 ...

  6. Cesium 初始化Viewer

    <pre name="code" class="javascript"><script> var viewer = new Cesium ...

  7. Cesium 源码笔记[1] Viewer模块实例化的大致过程

    我原本想写日记的,但是不太现实. 源码下载 源码可以从源码包和发行包中的Source目录中获取. Cesium的模块化机制从1.63版本开始,由原来的RequireJs变为ES6.但有可能是原先设计耦 ...

  8. Cesium应用篇:1快速搭建

    范例中所有范例可以在Github中搜索:ExamplesforCesium Cesium ['siːzɪəm]是一款开源的JavaScript开源库,开发者通过Cesium,实现无插件的创建三维球和二 ...

  9. [原创.数据可视化系列之二]使用cesium三维地图展示美国全球军事基地分布

    基于浏览器的三维地图还算是一个比较高冷的东西,最主要的技术难点是如何在浏览器上 多快好省 的显示三维数据,很遗憾,还真的没有太好的的方案,只能说还有可行的方案. 很久之前用过skyline,使用CS居 ...

随机推荐

  1. Charles安装教程

    一, 简介及安装 —,charles的使用 1.1   charles的说明 Charles其实是一款代理服务器,通过过将自己设置成系统(电脑或者浏览器)的网络访问代理服务器,然后截取请求和请求结果达 ...

  2. C#中部分重点前端设置问题

    背景 在工作及学习过程中经常会遇到一些奇怪的需求,这里便会记录我遇到的奇怪需求及解决方法. 内容 一.动态设置页面标题 1.前端设置 JS代码: document.title="这是一个标题 ...

  3. JS红宝书笔记——第一章 JavaScript简介

    1.JavaScript简史 Netscape公司决定开发一种客户端语言用来处理浏览器端简单的表单验证. Netscape公司派布兰登·艾奇(BrendanEich)为计划于1995年2月发布的Net ...

  4. day52:django:ORM单表/多表操作

    目录 1.ORM 2.ORM单表增删改查 13个必知必会的查询接口 filter基于双下划线的模糊查询 3.ORM多表增删改查 ORM 什么是ORM? ORM(object relational ma ...

  5. Nginx反代MogileFS集群

    上一篇博文我们主要聊了下分布式文件系统MogileFS的组件以及部署使用,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/13677279.html:今天我们主要 ...

  6. mariadb 4

    连接查询,视图,事物,索引,外键(第四章)   连接查询 --创建学生表 create table students ( id int unsigned not null auto_increment ...

  7. Docker数据卷Volume实现文件共享、数据迁移备份(三)

    数据卷volume功能特性 数据卷 是一个可供一个或多个容器使用的特殊目录,实现让容器中的一个目录和宿主机中的一个文件或者目录进行绑定.数据卷 是被设计用来持久化数据的对于数据卷你可以理解为NFS中的 ...

  8. Java审计之命令执行篇

    Java审计之命令执行篇 0x00 前言 在Java中能执行命令的类其实并不多,不像php那样各种的命令执行函数.在Java中目前所知的能执行命令的类也就两种,分别是Runtime和 ProcessB ...

  9. mysql-12-DDL

    #DDL /* 数据定义语言 库和表的管理 一.库的管理 创建.修改.删除 二.表的管理 创建.修改.删除 创建 create 修改 alter 删除 drop */ #一.库的管理 #1.库的创建 ...

  10. Python练习题 021:递归方法求阶乘

    [Python练习题 021] 利用递归方法求5!. ---------------------------------------------- 首先得弄清楚:5! 指的是"5的阶乘&qu ...