Class: PolylineGeometry

PolylineGeometry

new PolylineGeometry()

用于描述折线几何体类,支持以线带(line strip)形式建模,由连续线段构成,适用于动态或静态折线渲染

Name Type Default Description
options.positions Array.<Cartesian3>

一个由 Cartesian3 数组组成的数组,用于定义多边形边线的顶点位置。

options.width Number 1.0 可选

以像素为单位的宽度。

options.colors Array.<Color> 可选

定义每个顶点或每个线段颜色的 Color 数组。

options.colorsPerVertex Boolean false 可选

boolean用于确定颜色是在直线的每个线段上平铺,还是在顶点上插值。

options.followSurface Boolean true 可选

boolean用于确定位置是否将通过大弧调整到椭球面的表面。

options.granularity Number Math.RADIANS_PER_DEGREE 可选

如果options.followSurface=true,则每个经纬度之间的距离(以弧度为单位)。确定buffer中位置的数目。

options.vertexFormat VertexFormat VertexFormat.DEFAULT 可选

要计算的顶点属性。

options.ellipsoid Ellipsoid Ellipsoid.WGS84 可选

将椭球用作参考。

See:
  • PolylineGeometry#createGeometry
Throws:
  • 至少需要2个 positions。

    Type
    DeveloperError
  • 宽度必须大于或等于1。

    Type
    DeveloperError
  • 颜色的长度无效。

    Type
    DeveloperError
Example
// A polyline with two connected line segments
var polyline = new SuperMap3D.PolylineGeometry({
  positions : SuperMap3D.Cartesian3.fromDegreesArray([
    0.0, 0.0,
    5.0, 0.0,
    5.0, 5.0
  ]),
  width : 10.0
});
var geometry = SuperMap3D.PolylineGeometry.createGeometry(polyline);

Members

packedLengthNumber

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

Methods

static createGeometry(polylineGeometry){Geometry|undefined}

该函数计算多边形的几何表示,包括其顶点、索引和包围球。

Name Type Description
polylineGeometry PolylineGeometry

对折线的描述。

Returns:
Type Description
Geometry | undefined 计算出的顶点和索引。

static pack(value, array, startingIndex){Array.<Number>}

将提供的实例存储到提供的数组中。

Name Type Default Description
value PolylineGeometry

要打包的值。

array Array.<Number>

要打包的数组。

startingIndex Number 0 可选

开始打包元素的数组索引。

Returns:
Type Description
Array.<Number> 装入的数组。

static unpack(array, startingIndex, result){PolylineGeometry}

从打包数组中检索实例。

Name Type Default Description
array Array.<Number>

打包的数组。

startingIndex Number 0 可选

要解包的元素的起始索引

result PolylineGeometry 可选

存储结果的对象。

Returns:
Type Description
PolylineGeometry 修改后的结果参数或新的PolylineGeometry实例(如果没有提供)。