new Cesium.EquirectangularPanorama(options)

A Panorama that displays imagery in equirectangular format in a scene.
Name Type Description
options EquirectangularPanorama.ConstructorOptions 描述初始化选项的对象
Example:
const position = Cesium.Cartesian3.fromDegrees(
  -75.1699,  // longitude
  39.9522,   // latitude
  100.0      // height in meters
);

const heading = Cesium.Math.toRadians(45.0); // rotation about up axis
const pitch = Cesium.Math.toRadians(-30.0);   // pitch (negative looks down)
const roll = Cesium.Math.toRadians(10.0);    // roll about forward axis

const hpr = new Cesium.HeadingPitchRoll(
  heading,
  pitch,
  roll
);

const modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame(
  position,
  hpr,
  Cesium.Ellipsoid.WGS84,
  Cesium.Transforms.eastNorthUpToFixedFrame
);

scene.primitives.add(new Cesium.EquirectangularPanorama({
  transform: modelMatrix,
  image: 'path/to/image',
}));
Demo:

Members

readonly credit : Credit

获得全景的学分.

readonly image : string|HTMLImageElement|HTMLCanvasElement|ImageBitmap

获得全景的源图像.

readonly radius : number

获得全景半径.

show : boolean

确定是否显示正方形全景.

readonly transform : Matrix4

得到全景的转变.

Methods

destroy()

Destroys the WebGL resources held by this object. Destroying an object allows for deterministic 释放 WebGL 资源,而不是依赖垃圾收集器来摧毁此对象.

Once an object is destroyed, it should not be used; calling any function other than isDestroyed will result in a DeveloperError exception. Therefore, assign the return value (undefined) to the object as done in the example.
Throws:
  • DeveloperError : This object was destroyed, i.e., destroy() was called.
Example:
equirectangularPanorama = equirectangularPanorama && equirectangularPanorama.destroy();
See:

isDestroyed()boolean

如果此对象被销毁, 返回真实; 否则, 错误 .

If this object was destroyed, it should not be used; calling any function other than isDestroyed will result in a DeveloperError exception.
Returns:
true if this object was destroyed; otherwise, false.
See:

update()

Called when Viewer or CesiumWidget render the scene to 获得使这个原始化所需的绘图命令.

不要直接调用此函数 。 记录下来的只是 列出场景拍摄时可能宣传的例外情况:

Type Definitions

Cesium.EquirectangularPanorama.ConstructorOptions

EquirectangularPanorama 构造器的初始化选项
Properties:
Name Type Attributes Default Description
options.transform Matrix4 定义全景位置和方向的 4x4 变换矩阵 (例如,来自一个位置和标题-pitch-roll).
options.image string | HTMLImageElement | HTMLCanvasElement | ImageBitmap 一个 URL 到图像资源, 或预装图像对象 .
options.radius number <optional>
100000.0 The radius of the panorama in meters.
options.repeatHorizontal number <optional>
1.0 横向重复纹理的次数.
options.repeatVertical number <optional>
1.0 垂直重复纹理的次数.
options.credit Credit | string <optional>
在画布上展示的全景的功劳.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.