GroundPolylineGeometry

new Cesium.GroundPolylineGeometry(options)

描述位于地形或 3D Tiles 上的折线。仅与 GroundPolylinePrimitive 配合使用。
Name Type Description
options object 包含以下属性的对象:
Name Type Default Description
positions Array.<Cartesian3> 定义折线点的 Cartesian3 数组。高于椭球的高度将被忽略。
width number 1.0 optional 屏幕空间宽度(像素)。
granularity number 9999.0 optional 用于插值 options.points 的距离间隔(米)。默认为 9999.0 米。零表示不进行插值。
loop boolean false optional 在创建几何时,是否在最后一个和第一个位置之间添加线段以形成闭合折线。
arcType ArcType ArcType.GEODESIC optional 折线段必须遵循的线类型。有效选项为 ArcType.GEODESICArcType.RHUMB
Throws:
Example:
const positions = Cesium.Cartesian3.fromDegreesArray([
  -112.1340164450331, 36.05494287836128,
  -112.08821010582645, 36.097804071380715,
  -112.13296079730024, 36.168769146801104
]);

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

Members

The type of path the polyline must follow. Valid options are ArcType.GEODESIC and ArcType.RHUMB.
Default Value: 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.
Default Value: 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.
Default Value: false
The screen space width in pixels.

Methods

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

Stores the provided instance into the provided array.
Name Type Default Description
value PolygonGeometry The value to pack.
array Array.<number> The array to pack into.
startingIndex number 0 optional The index into the array at which to start packing the elements.
Returns:
The array that was packed into

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

Retrieves an instance from a packed array.
Name Type Default Description
array Array.<number> The packed array.
startingIndex number 0 optional The starting index of the element to be unpacked.
result PolygonGeometry optional The object into which to store the result.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.