new Cesium.RectangleGeometry(options)

A description of a cartographic rectangle on an ellipsoid centered at the origin. Rectangle geometry can be rendered with both Primitive and GroundPrimitive.
Name Type Description
options object 下列属性的对象 :
Name Type Default Description
rectangle Rectangle 以弧度表示的具有北,南,东和西属性的制图矩.
vertexFormat VertexFormat VertexFormat.DEFAULT optional The vertex attributes to be computed.
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid on which the rectangle lies.
granularity number CesiumMath.RADIANS_PER_DEGREE optional The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
height number 0.0 optional 矩形与椭圆形表面之间的米数距离.
rotation number 0.0 optional 矩形的旋转,以弧度表示. 正旋转是逆时针.
stRotation number 0.0 optional 纹理坐标的旋转,以弧度表示. 正旋转是逆时针.
extrudedHeight number optional 长方形外凸面与椭圆形表面之间以米为单位的距离.
Throws:
  • DeveloperError : options.rectangle.north must be in the interval [-Pi/2, Pi/2].
  • DeveloperError : options.rectangle.south must be in the interval [-Pi/2, Pi/2].
  • DeveloperError : options.rectangle.east must be in the interval [-Pi, Pi].
  • DeveloperError : options.rectangle.west must be in the interval [-Pi, Pi].
  • DeveloperError : options.rectangle.north must be greater than options.rectangle.south.
Example:
// 1. create a rectangle
const rectangle = new Cesium.RectangleGeometry({
  ellipsoid : Cesium.Ellipsoid.default,
  rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  height : 10000.0
});
const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);

// 2. create an extruded rectangle without a top
const rectangle = new Cesium.RectangleGeometry({
  ellipsoid : Cesium.Ellipsoid.default,
  rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
  height : 10000.0,
  extrudedHeight: 300000
});
const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
Demo:
See:
  • RectangleGeometry#createGeometry

Members

static Cesium.RectangleGeometry.packedLength : number

用于将对象组合成数组的元素数量.

Methods

static Cesium.RectangleGeometry.computeRectangle(options, result)Rectangle

根据提供的选项计算边框矩形
Name Type Description
options object 下列属性的对象 :
Name Type Default Description
rectangle Rectangle 以弧度表示的具有北,南,东和西属性的制图矩.
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid on which the rectangle lies.
granularity number CesiumMath.RADIANS_PER_DEGREE optional The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
rotation number 0.0 optional 矩形的旋转,以弧度表示. 正旋转是逆时针.
result Rectangle optional 存储结果的对象 .
Returns:
结果矩形

static Cesium.RectangleGeometry.createGeometry(rectangleGeometry)Geometry|undefined

计算一个矩形的几何表示,包括它的顶点,指数,和边框.
Name Type Description
rectangleGeometry RectangleGeometry 长方形的描述.
Returns:
计算出的顶点和指数.
Throws:

static Cesium.RectangleGeometry.pack(value, array, startingIndex)Array.<number>

将所提供的实例存储到所提供的数组中.
Name Type Default Description
value RectangleGeometry 包装的价值.
array Array.<number> 装入的阵列.
startingIndex number 0 optional The index into the array at which to start packing the elements.
Returns:
装入的阵列

static Cesium.RectangleGeometry.unpack(array, startingIndex, result)RectangleGeometry

从组合的数组中获取实例 .
Name Type Default Description
array Array.<number> 装填的阵列.
startingIndex number 0 optional The starting index of the element to be unpacked.
result RectangleGeometry optional 存储结果的对象.
Returns:
未提供修改的结果参数或新的矩形图形实例 .
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.