GroundPolylineGeometry

new Cesium.GroundPolylineGeometry(options)

地形或 3D 瓦片上的折线的描述。只能与 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

多段线必须遵循的路径类型。有效选项为 ArcType.GEODESICArcType.RHUMB
Default Value: ArcType.GEODESIC
用于插值 options.points 的距离间隔。零表示无插值。 默认值 9999.0 允许厘米级精度和 32 位浮点。
Default Value: 9999.0
在创建几何图形时,是否在最后一条和第一条线位置之间添加一条线段,以使该多段线成为循环。 如果几何体有两个位置,则此参数将被忽略。
Default Value: false
屏幕空间宽度(以像素为单位)。

Methods

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

将提供的实例存储到提供的数组中。
Name Type Default Description
value PolygonGeometry 要打包的值。
array Array.<number> 要装入的数组。
startingIndex number 0 optional 开始打包元素的数组的索引。
Returns:
被装入的数组

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

从打包数组中检索实例。
Name Type Default Description
array Array.<number> 打包数组。
startingIndex number 0 optional 要解压缩的元素的起始索引。
result PolygonGeometry optional 要在其中存储结果的对象。
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.