GroundPolylineGeometry

new Cesium.GroundPolylineGeometry(options)

A description of a polyline on terrain or 3D Tiles. Only to be used with GroundPolylinePrimitive.
参数名称 类型 描述信息
options object Options with the following properties:
参数名称 类型 默认值 描述信息
positions Array.<Cartesian3> An array of Cartesian3 defining the polyline's points. Heights above the ellipsoid will be ignored.
width number 1.0 可选 The screen space width in pixels.
granularity number 9999.0 可选 The distance interval in meters used for interpolating options.points. Defaults to 9999.0 meters. Zero indicates no interpolation.
loop boolean false 可选 Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.
arcType ArcType ArcType.GEODESIC 可选 The type of line the polyline segments must follow. Valid options are ArcType.GEODESIC and ArcType.RHUMB.
Throws:
使用示例:
const positions = Cesium.Cartesian3.fromDegreesArray([
  -112.1340164450331, 36.05494287836128,
  -112.08821010582645, 36.097804071380715,
  -112.13296079730024, 36.168769146801104
]);

const geometry = new Cesium.GroundPolylineGeometry({
  positions : positions
});
参考:

成员(属性)

The type of path the polyline must follow. Valid options are ArcType.GEODESIC and ArcType.RHUMB.
默认值: ArcType.GEODESIC
The distance interval used for interpolating options.points. Zero indicates no interpolation. Default of 9999.0 allows centimeter accuracy with 32 bit floating point.
默认值: 9999.0
Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop. If the geometry has two positions this parameter will be ignored.
默认值: false
The screen space width in pixels.

方法

static Cesium.GroundPolylineGeometry.pack(value, array, startingIndex)Array.<number>

Stores the provided instance into the provided array.
参数名称 类型 默认值 描述信息
value PolygonGeometry The value to pack.
array Array.<number> The array to pack into.
startingIndex number 0 可选 The index into the array at which to start packing the elements.
返回值:
The array that was packed into

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

Retrieves an instance from a packed array.
参数名称 类型 默认值 描述信息
array Array.<number> The packed array.
startingIndex number 0 可选 The starting index of the element to be unpacked.
result PolygonGeometry 可选 The object into which to store the result.