SimplePolylineGeometry

new Cesium.SimplePolylineGeometry(options)

对建模为线条条的多段线的描述;前两个位置定义线段, 每个附加的位置都定义了一条与前一个位置相距的线段。
Name Type Description
options Object 具有以下属性的对象:
Name Type Default Description
positions Array.<Cartesian3> 将折线中的位置定义为线条条的Cartesian3数组。
colors Array.<Color> optional 定义逐顶点或逐段颜色的Color数组。
colorsPerVertex Boolean false optional 一种布尔值,用于确定颜色是在直线的每个线段上平坦还是在顶点上插值。
arcType ArcType ArcType.GEODESIC optional 多段线线段必须遵循的直线类型。
granularity Number CesiumMath.RADIANS_PER_DEGREE optional 每个纬度和经度之间的距离,以弧度为单位,如果选项.arcType不是弧型。无. 确定缓冲区中的位置数。
ellipsoid Ellipsoid Ellipsoid.WGS84 optional 用作参考的椭球体。
Throws:
Example:
// A polyline with two connected line segments
var polyline = new Cesium.SimplePolylineGeometry({
  positions : Cesium.Cartesian3.fromDegreesArray([
    0.0, 0.0,
    5.0, 0.0,
    5.0, 5.0
  ])
});
var geometry = Cesium.SimplePolylineGeometry.createGeometry(polyline);
See:
  • SimplePolylineGeometry#createGeometry

Members

packedLength : Number

用于将对象打包到数组中的元素数。

Methods

static Cesium.SimplePolylineGeometry.createGeometry(simplePolylineGeometry)Geometry|undefined

计算简单多段线的几何表示,包括其顶点、索引和边界球体。
Name Type Description
simplePolylineGeometry SimplePolylineGeometry 折线的描述。
Returns:
计算的顶点和索引。

static Cesium.SimplePolylineGeometry.pack(value, array, startingIndex)Array.<Number>

将提供的实例存储到提供的数组中。
Name Type Default Description
value SimplePolylineGeometry 要打包的值。
array Array.<Number> 要打包到的数组。
startingIndex Number 0 optional 数组中开始打包元素的索引。
Returns:
被压缩到的数组

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

从压缩数组检索实例。
Name Type Default Description
array Array.<Number> 压缩数组。
startingIndex Number 0 optional 要解包的元素的起始索引。
result SimplePolylineGeometry optional 要将结果存储到其中的对象。
Returns:
修改后的结果参数或新的SimplePolylineGeometry实例(如果未提供实例)。