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

折线必须遵循的路径类型。有效选项为 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 用于存储结果的物体。
需要帮助?获取答案的最快方式是在 Cesium 论坛 上向社区和团队提问。