English中文

PolylineGraphics

new Cesium.PolylineGraphics(options)

描述多段线。前两个位置定义一条线段,每个附加位置定义与前一个位置的一条线段。这些线段可以是线性连接点、大弧线或固定在地形上。 Describes a polyline. The first two positions define a line segment, and each additional position defines a line segment from the previous position. The segments can be linear connected points, great arcs, or clamped to terrain.
名称 Name 类型 Type 说明 Description
options PolylineGraphics.ConstructorOptions 可选 optional 描述初始化选项的对象 Object describing initialization options
演示: Demo:
另见: See:

成员 Members

获取或设置 Gets or sets the ArcType 属性指定线段应该是大弧、恒向线还是线性连接。 Property specifying whether the line segments should be great arcs, rhumb lines or linearly connected.
默认值: Default Value: ArcType.GEODESIC
获取或设置布尔属性,指定折线是否应夹紧到地面。 Gets or sets the boolean Property specifying whether the polyline should be clamped to the ground.
默认值: Default Value: false
获取或设置 Gets or sets the ClassificationType 属性指定该折线在地面上时是否对地形、3D 切片或两者进行分类。 Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground.
默认值: Default Value: ClassificationType.BOTH
获取每当更改或修改属性或子属性时引发的事件。 Gets the event that is raised whenever a property or sub-property is changed or modified.
获取或设置指定在深度测试失败时用于绘制折线的材质的属性。 Gets or sets the Property specifying the material used to draw the polyline when it fails the depth test.

需要 EXT_frag_depth WebGL 扩展才能正确渲染。如果不支持扩展,则可能会出现工件。 Requires the EXT_frag_depth WebGL extension to render properly. If the extension is not supported, there may be artifacts.

默认值: Default Value: undefined

distanceDisplayCondition : Property|undefined

获取或设置 Gets or sets the DistanceDisplayCondition 属性指定该多段线将在距相机的距离处显示。 Property specifying at what distance from the camera that this polyline will be displayed.
如果 arcType 不是 ArcType.NONE 且 lampToGround 为 false,则获取或设置指定每个纬度和经度之间的角距离的数值属性。 Gets or sets the numeric Property specifying the angular distance between each latitude and longitude if arcType is not ArcType.NONE and clampToGround is false.
默认值: Default Value: Cesium.Math.RADIANS_PER_DEGREE
获取或设置指定用于绘制折线的材质的属性。 Gets or sets the Property specifying the material used to draw the polyline.
默认值: Default Value: Color.WHITE
获取或设置指定数组的属性 Gets or sets the Property specifying the array of Cartesian3 定义线带的位置。 positions that define the line strip.
获取或设置枚举属性,指定折线是否投射或接收来自光源的阴影。 Get or sets the enum Property specifying whether the polyline casts or receives shadows from light sources.
默认值: Default Value: ShadowMode.DISABLED
获取或设置指定折线可见性的布尔属性。 Gets or sets the boolean Property specifying the visibility of the polyline.
默认值: Default Value: true
获取或设置指定宽度(以像素为单位)的数字属性。 Gets or sets the numeric Property specifying the width in pixels.
默认值: Default Value: 1.0
获取或设置指定折线顺序的 zIndex 属性。仅当“clampToGround”为 true 并且支持地形上的折线时才有效。 Gets or sets the zIndex Property specifying the ordering of the polyline. Only has an effect if `clampToGround` is true and polylines on terrain is supported.
默认值: Default Value: 0

方法 Methods

复制此实例。 Duplicates this instance.
名称 Name 类型 Type 说明 Description
result PolylineGraphics 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新实例(如果未提供)。 The modified result parameter or a new instance if one was not provided.
将此对象上每个未分配的属性分配给所提供的源对象上相同属性的值。 Assigns each unassigned property on this object to the value of the same property on the provided source object.
名称 Name 类型 Type 说明 Description
source PolylineGraphics 要合并到此对象中的对象。 The object to be merged into this object.

类型定义 Type Definitions

Cesium.PolylineGraphics.ConstructorOptions

PolylineGraphics 构造函数的初始化选项 Initialization options for the PolylineGraphics constructor
属性: Properties:
名称 Name 类型 Type Attributes 默认值 Default 说明 Description
show Property | boolean <可选> &lt;optional>
true 指定折线可见性的布尔属性。 A boolean Property specifying the visibility of the polyline.
positions Property | Array.<Cartesian3> <可选> &lt;optional>
指定数组的属性 A Property specifying the array of Cartesian3 定义线带的位置。 positions that define the line strip.
width Property | number <可选> &lt;optional>
1.0 指定宽度(以像素为单位)的数字属性。 A numeric Property specifying the width in pixels.
granularity Property | number <可选> &lt;optional>
Cesium.Math.RADIANS_PER_DEGREE 如果 arcType 不是 ArcType.NONE,则指定每个纬度和经度之间的角距离的数字属性。 A numeric Property specifying the angular distance between each latitude and longitude if arcType is not ArcType.NONE.
material MaterialProperty | Color <可选> &lt;optional>
Color.WHITE 指定用于绘制折线的材质的属性。 A Property specifying the material used to draw the polyline.
depthFailMaterial MaterialProperty | Color <可选> &lt;optional>
指定当折线位于地形下方时用于绘制折线的材质的属性。 A property specifying the material used to draw the polyline when it is below the terrain.
arcType Property | ArcType <可选> &lt;optional>
ArcType.GEODESIC 折线段必须遵循的线条类型。 The type of line the polyline segments must follow.
clampToGround Property | boolean <可选> &lt;optional>
false 一个布尔属性,指定折线是否应固定在地面上。 A boolean Property specifying whether the Polyline should be clamped to the ground.
shadows Property | ShadowMode <可选> &lt;optional>
ShadowMode.DISABLED 一个枚举属性,指定折线是否投射或接收来自光源的阴影。 An enum Property specifying whether the polyline casts or receives shadows from light sources.
distanceDisplayCondition Property | DistanceDisplayCondition <可选> &lt;optional>
一个属性,指定该多段线将在距相机的距离处显示。 A Property specifying at what distance from the camera that this polyline will be displayed.
classificationType Property | ClassificationType <可选> &lt;optional>
ClassificationType.BOTH 一个枚举属性,指定该折线在地面上时是否对地形、3D Tiles或两者进行分类。 An enum Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground.
zIndex Property | number <可选> &lt;optional>
0 指定用于排序地面几何体的 zIndex 的属性。仅当“clampToGround”为 true 并且支持地形上的折线时才有效。 A Property specifying the zIndex used for ordering ground geometry. Only has an effect if `clampToGround` is true and polylines on terrain is supported.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.