SceneModePicker

new Cesium.SceneModePicker(container, scene, duration)

SceneModePicker 是一个用于在场景模式之间切换的单按钮控件; 图中左侧显示的是其展开状态。只要用于执行切换的是指定的 Scene, 场景模式的程序化切换就会 自动反映到该控件中。


Name Type Default Description
container Element | string 将包含该控件的 DOM 元素或 ID。
scene Scene 要使用的 Scene 实例。
duration number 2.0 optional 场景完成过渡所需的时间(秒)。
Throws:
  • DeveloperError :文档中不存在 id 为 "container" 的元素。
Example:
// In HTML head, include a link to the SceneModePicker.css stylesheet,
// and in the body, include: <div id="sceneModePickerContainer"></div>
// Note: This code assumes you already have a Scene instance.

const sceneModePicker = new Cesium.SceneModePicker('sceneModePickerContainer', scene);

Members

获取父容器。
获取视图模型。

Methods

销毁该控件。如果要将控件从布局中永久移除,应调用此方法。
Returns:
如果对象已被销毁则为 true,否则为 false。
需要帮助?获取答案的最快方式是在 Cesium 论坛 上向社区和团队提问。