new Cesium.SimplePolylineGeometry(options)

描述一个多线条模型作为线条;前两个位置定义了线段, 和每个附加位置定义了上一个位置的线段.
Name Type Description
options object 下列属性的对象 :
Name Type Default Description
positions Array.<Cartesian3> An array of Cartesian3 defining the positions in the polyline as a line strip.
colors Array.<Color> optional An Array of Color defining the per vertex or per segment colors.
colorsPerVertex boolean false optional A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices.
arcType ArcType ArcType.GEODESIC optional The type of line the polyline segments must follow.
granularity number CesiumMath.RADIANS_PER_DEGREE optional The distance, in radians, between each latitude and longitude if options.arcType is not ArcType.NONE. Determines the number of positions in the buffer.
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid to be used as a reference.
Throws:
Example:
// A polyline with two connected line segments
const polyline = new Cesium.SimplePolylineGeometry({
  positions : Cesium.Cartesian3.fromDegreesArray([
    0.0, 0.0,
    5.0, 0.0,
    5.0, 5.0
  ])
});
const 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 The index into the array at which to start packing the elements.
Returns:
装入的阵列

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

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