Cesium Note16:全屏

Cesium Note16:全屏

全屏

// Put the entire page into fullscreen. Cesium.Fullscreen.requestFullscreen(document.body) // Place only the Cesium canvas into fullscreen. Cesium.Fullscreen.requestFullscreen(scene.canvas)
 

退出全屏

 
Cesium.Fullscreen.exitFullscreen()
 
 

Methods:

1、退出全屏显示
Cesium.Fullscreen.exitFullscreen()
解释:Asynchronously exits fullscreen mode. If the browser is not currently in fullscreen, or if fullscreen mode is not supported by the browser, does nothing.
2、全屏显示
Cesium.Fullscreen.requestFullscreen(element, vrDevice)
解释:
Asynchronously requests the browser to enter fullscreen mode on the given element. If fullscreen mode is not supported by the browser, does nothing.
Name
Type
Description
element
Object
The HTML element which will be placed into fullscreen mode.
vrDevice
HMDVRDevice
optionalThe VR device.
Example:
// Put the entire page into fullscreen. Cesium.Fullscreen.requestFullscreen(document.body) // Place only the Cesium canvas into fullscreen. Cesium.Fullscreen.requestFullscreen(scene.canvas)