Cesium Widget这个案例展示了一个Cesium的简化窗体。在之前的案例中使用的都是Cesium.Viewer这个窗体组件,包含了非常丰富的组件内容。Cesium.CesiumWidget可以说是其简化版本,不包含动画、图层选择等等其他组件内容,仅仅显示一个三维数字地球。并且,默认情况下也不会包含Cesium地形的图层。之前网上很多的问题是关于如何在Cesium.Viewer组件中隐藏所有的元素,现在似乎直接用Cesium.CesiumWidget这个组件就可以了。

JS代码实现如下:

'use strict';

// Cesium.CesiumWidget is similar to Cesium.Viewer, but
// is trimmed down.  It is just a widget for the 3D globe;
// it does not include the animation, imagery selection,
// and other widgets, nor does it depend on the third-party
// Knockout library.
var widget = new Cesium.CesiumWidget('cesiumContainer');

显示效果:
Cesium案例解析(八)——CesiumWidget简化窗体

如果需要隐藏Cesium版权信息,可以在页面中增加一段CSS代码:

.cesium-widget-credits {
    display: none !important;
    visibility: hidden !important;
}

2. 参考

  1. cesium随笔 — 隐藏三维场景下方版权信息

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2022-01-08
猜你喜欢
  • 2023-04-07
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
  • 2021-08-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案