文章標題

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章