用于描述折线几何体类,支持以线带(line strip)形式建模,由连续线段构成,适用于动态或静态折线渲染
Name | Type | Default | Description |
---|---|---|---|
options.positions |
Array.<Cartesian3> |
一个由 Cartesian3 数组组成的数组,用于定义多边形边线的顶点位置。 |
|
options.width |
Number |
1.0
|
optional 以像素为单位的宽度。 |
options.colors |
Array.<Color> |
optional
定义每个顶点或每个线段颜色的 Color 数组。 |
|
options.colorsPerVertex |
Boolean |
false
|
optional boolean用于确定颜色是在直线的每个线段上平铺,还是在顶点上插值。 |
options.followSurface |
Boolean |
true
|
optional boolean用于确定位置是否将通过大弧调整到椭球面的表面。 |
options.granularity |
Number |
Math.RADIANS_PER_DEGREE
|
optional 如果options.followSurface=true,则每个经纬度之间的距离(以弧度为单位)。确定buffer中位置的数目。 |
options.vertexFormat |
VertexFormat |
VertexFormat.DEFAULT
|
optional 要计算的顶点属性。 |
options.ellipsoid |
Ellipsoid |
Ellipsoid.WGS84
|
optional 将椭球用作参考。 |
Throws:
-
DeveloperError : 至少需要2个 positions。
-
DeveloperError : 宽度必须大于或等于1。
-
DeveloperError : 颜色的长度无效。
- PolylineGeometry#createGeometry
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);
See:
Members
-
用于将对象打包到数组中的元素个数。
Methods
-
staticSuperMap3D.PolylineGeometry.createGeometry(polylineGeometry) → Geometry|undefined
-
该函数计算多边形的几何表示,包括其顶点、索引和包围球。
Name Type Description polylineGeometry
PolylineGeometry 对折线的描述。 Returns:
计算出的顶点和索引。 -
将提供的实例存储到提供的数组中。
Name Type Default Description value
PolylineGeometry 要打包的值。 array
Array.<Number> 要打包的数组。 startingIndex
Number 0
optional 开始打包元素的数组索引。 Returns:
装入的数组。 -
staticSuperMap3D.PolylineGeometry.unpack(array, startingIndex, result) → PolylineGeometry
-
从打包数组中检索实例。
Name Type Default Description array
Array.<Number> 打包的数组。 startingIndex
Number 0
optional 要解包的元素的起始索引 result
PolylineGeometry optional 存储结果的对象。 Returns:
修改后的结果参数或新的PolylineGeometry实例(如果没有提供)。