用于创建折线(多段线)的几何类,以“线带”(line strip)形式建模,连续线段首尾相连,支持颜色插值或分段着色。
Name | Type | Default | Description |
---|---|---|---|
options.positions |
Array.<Cartesian3> |
一个由 Cartesian3 组成的数组,将多段线中的位置定义为线段。 |
|
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.ellipsoid |
Ellipsoid |
Ellipsoid.WGS84
|
optional 用作参考的椭球体。 |
Throws:
-
DeveloperError : 至少需要2个positions。
-
DeveloperError : 颜色的长度无效。
- SimplePolylineGeometry#createGeometry
Example:
// A polyline with two connected line segments
var polyline = new SuperMap3D.SimplePolylineGeometry({
positions : SuperMap3D.Cartesian3.fromDegreesArray([
0.0, 0.0,
5.0, 0.0,
5.0, 5.0
])
});
var geometry = SuperMap3D.SimplePolylineGeometry.createGeometry(polyline);
See:
Members
-
用于将对象打包到数组中的元素个数。
Methods
-
staticSuperMap3D.SimplePolylineGeometry.createGeometry(simplePolylineGeometry) → Geometry
-
计算简单折线的几何表示,包括其顶点、索引和包围球。
Name Type Description simplePolylineGeometry
SimplePolylineGeometry 对折线的描述。 Returns:
计算出的顶点和索引。 -
将提供的实例存储到提供的数组中。
Name Type Default Description value
SimplePolylineGeometry 要打包的值。 array
Array.<Number> 要装入的数组。 startingIndex
Number 0
optional 开始打包元素的数组的索引。 Returns:
被装入的数组。 -
staticSuperMap3D.SimplePolylineGeometry.unpack(array, startingIndex, result) → SimplePolylineGeometry
-
从打包数组中检索实例。
Name Type Default Description array
Array.<Number> 打包数组。 startingIndex
Number 0
optional 要解压缩的元素的起始索引。 result
SimplePolylineGeometry optional 存储结果的对象。 Returns:
修改后的结果参数,或者一个新的 SimplePolylineGeometry 实例(如果没有提供)。