文章标题

cesium学习2–空间数据可视化

  1. 官方文档阅读
Cesium has a rich API for spatial data that can be split into two categories: a low-level API geared towards graphics developers, commonly referred to as the Primitive API, and a high-level API for data-driven visualization, referred to as the Entity API.

Cesium提供俩种空间数据可视化接口

 Most applications are better served with a higher level of abstraction than what is offered by the Primitive API.Entity,It lets us concentrate on the presentation of our data rather than worrying about the underlying mechanism of visualization

推荐使用高度封装抽象的接口Entity

Entity features in the Viewer:Selection and Description

wyoming.description = '
<img
  width="50%"
  style="float:left; margin: 0 1em 1em 0;"
  src="//cesiumjs.org/images/2015/02-02/Flag_of_Wyoming.svg"/>
<p>
  Wyoming is a state in the mountain region of the Western 
  United States.
</p>
<p>
  Wyoming is the 10th most extensive, but the least populous 
  and the second least densely populated of the 50 United 
  States. The western two thirds of the state is covered mostly 
  with the mountain ranges and rangelands in the foothills of 
  the eastern Rocky Mountains, while the eastern third of the 
  state is high elevation prairie known as the High Plains. 
  Cheyenne is the capital and the most populous city in Wyoming, 
  with a population estimate of 62,448 in 2013.
</p>
<p>
  Source: 
  <a style="color: WHITE"
    target="_blank"
    href="http://en.wikipedia.org/wiki/Wyoming">Wikpedia</a>';

这一行代码写在js文件里面,写为一行,不然报错。
另外,根据官方介绍cesium可以:
- 可以设置浏览角度
- 可以设置实体介绍内容
- 可以有俩种缩放至目标效果flyto,zoomto方式
- 可以动态跟踪目标

Sometimes, particularly when working with time-dynamic data, we want the camera to remain centered on an entity rather than on the Earth. This is accomplished by setting the viewer.trackedEntity property. 

Managing Entities:实体对象管理

EntityCollection is an associative array that makes managing and monitoring a group of entities easy. We’ve already encountered one instance of it in the form of the viewer.entities property. EntityCollection includes traditional methods such as add, remove, and removeAll;

每一个空间对象都有一个唯一的id属性

 All Entity instances have a unique id property that can be used for such cases. Since we didn’t specify an identifier in our first example, Cesium generated a GUID for us

创建一个实体对象,并编号,加入到集合中

var entity = new Entity({
  id : 'uniqueId'
});
viewer.entities.add(entity);
  • 该事件collectionChanged Event可以用来监测数据变化。
  • 广告牌Of course using a point isn’t very exciting, so we can replace the
    point with a billboard, which is a marker that’s always facing the
    user.

3D Models
Cesium supports 3D Models via glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL. It also includes a few ready-to-use glTF models

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值