Fullscreen

独立于浏览器的函数,用于使用标准全屏 API。
See:

Members

static readonly Cesium.Fullscreen.changeEventName : string

当 fullscreen 为 已进入或已退出。 此事件名称旨在与 addEventListener 一起使用。 在事件处理程序中,要确定浏览器是否处于全屏模式, 使用 Fullscreen#fullscreen

static readonly Cesium.Fullscreen.element : object

当前全屏的元素(如果有)。 要简单地检查 浏览器是否处于全屏模式,请使用 Fullscreen#fullscreen

static readonly Cesium.Fullscreen.enabled : boolean

确定浏览器是否允许将元素全屏显示。 例如,默认情况下,iframe 无法全屏显示,除非包含页面 添加 “allowFullScreen” 属性(或前缀等效属性)。

static readonly Cesium.Fullscreen.errorEventName : string

全屏错误时触发的事件的名称 发生。 此事件名称旨在与 addEventListener 一起使用。

static readonly Cesium.Fullscreen.fullscreen : boolean

确定浏览器当前是否处于全屏模式。

Methods

static Cesium.Fullscreen.exitFullscreen()

异步退出全屏模式。 如果浏览器当前未 在全屏模式下,或者如果浏览器不支持全屏模式,则不执行任何操作。

static Cesium.Fullscreen.requestFullscreen(element, vrDevice)

异步请求浏览器在给定元素上进入全屏模式。 如果浏览器不支持全屏模式,则不执行任何操作。
Name Type Description
element object 将置于全屏模式的 HTML 元素。
vrDevice object optional HMDVRDevice 设备。
Example:
// Put the entire page into fullscreen.
Cesium.Fullscreen.requestFullscreen(document.body)

// Place only the Cesium canvas into fullscreen.
Cesium.Fullscreen.requestFullscreen(scene.canvas)

static Cesium.Fullscreen.supportsFullscreen()boolean

检测浏览器是否支持标准的全屏 API。
Returns:
true,如果浏览器支持标准的全屏 API, 否则 false
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.