描述由一系列线性环组成的多边形,这些线性环构成其外轮廓以及任意嵌套的孔洞。
该多边形贴合地球的曲率,可以放置在地球表面或
一定的高度上,并且可以选择性地拉伸为一个体。
| Name | Type | Description |
|---|---|---|
options |
PolygonGraphics.ConstructorOptions | optional 描述初始化选项的对象。 |
Demo:
See:
Members
arcType : Property|undefined
获取或设置
ArcType 属性,指定多边形边缘所使用的线的类型。
-
Default Value:
ArcType.GEODESIC
classificationType : Property|undefined
获取或设置
ClassificationType 属性,指定当此多边形位于地面上时,它将对地形、3D Tiles 还是两者进行分类。
-
Default Value:
ClassificationType.BOTH
closeBottom : Property|undefined
获取或设置一个布尔值,指定是否包含拉伸多边形的底部。
closeTop : Property|undefined
获取或设置一个布尔值,指定是否包含拉伸多边形的顶部。
readonly definitionChanged : Event
获取当某个属性或子属性发生更改时被触发的事件。
distanceDisplayCondition : Property|undefined
获取或设置
DistanceDisplayCondition 属性,指定此多边形将在距离相机多远时显示。
extrudedHeight : Property|undefined
获取或设置数值属性,指定多边形拉伸的高度。
如果
PolygonGraphics#perPositionHeight 为 false,则体从 PolygonGraphics#height 开始,并在此高度结束。
如果 PolygonGraphics#perPositionHeight 为 true,则体从每个 PolygonGraphics#hierarchy 位置的高度开始,并在此高度结束。
extrudedHeightReference : Property|undefined
获取或设置指定拉伸
HeightReference 的属性。
-
Default Value:
HeightReference.NONE
fill : Property|undefined
获取或设置布尔属性,指定多边形是否使用所提供的材质进行填充。
-
Default Value:
true
granularity : Property|undefined
获取或设置数值属性,指定多边形上各点之间的角距离。
-
Default Value:
{CesiumMath.RADIANS_PER_DEGREE}
height : Property|undefined
获取或设置数值属性,指定多边形的恒定高度。
-
Default Value:
0.0
heightReference : Property|undefined
获取或设置指定
HeightReference 的属性。
-
Default Value:
HeightReference.NONE
hierarchy : Property|undefined
获取或设置指定
PolygonHierarchy 的属性。
获取或设置指定用于填充多边形的材质的属性。
-
Default Value:
Color.WHITE
outline : Property|undefined
获取或设置指定多边形是否带有轮廓的属性。
-
Default Value:
false
outlineColor : Property|undefined
获取或设置指定轮廓
Color 的属性。
-
Default Value:
Color.BLACK
outlineWidth : Property|undefined
获取或设置数值属性,指定轮廓的宽度。
注意:在 Windows 平台上的所有主流浏览器中,此属性将被忽略。详情请参阅 (@link https://github.com/CesiumGS/cesium/issues/40}。
-
Default Value:
1.0
perPositionHeight : Property|undefined
获取或设置布尔值,指定是否使用每个位置的高度。
如果为 true,则形状将具有由每个
PolygonGraphics#hierarchy 位置的高度定义的非均匀高度。
如果为 false,则形状将具有由 PolygonGraphics#height 指定的恒定高度。
shadows : Property|undefined
获取或设置枚举属性,指定多边形是否
投射或接收来自光源的阴影。
-
Default Value:
ShadowMode.DISABLED
show : Property|undefined
获取或设置布尔属性,指定多边形的可见性。
-
Default Value:
true
stRotation : Property|undefined
获取或设置数值属性,指定多边形纹理从正北方向逆时针旋转的角度。仅当未定义 textureCoordinates 时生效。
-
Default Value:
0
textureCoordinates : Property|undefined
一个属性,指定纹理坐标,形式为
PolygonHierarchy 的 Cartesian2 点。对地面图元无效。
zIndex : ConstantProperty|undefined
获取或设置 zIndex 属性,指定地面几何图形的排序。仅当多边形为常量且未指定 height 或 extrudedHeight 时生效。
-
Default Value:
0
Methods
clone(result) → PolygonGraphics
复制此实例。
| Name | Type | Description |
|---|---|---|
result |
PolygonGraphics | optional 用于存储结果的对象。 |
Returns:
修改后的 result 参数,如果未提供则返回新实例。
将此对象上每个未赋值的属性设为
所提供源对象上相同属性的值。
| Name | Type | Description |
|---|---|---|
source |
PolygonGraphics | 要合并到此对象中的对象。 |
Type Definitions
PolygonGraphics 构造函数的初始化选项
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
show |
Property | boolean |
<optional> |
true | 一个布尔属性,指定多边形的可见性。 |
hierarchy |
Property | PolygonHierarchy | Array.<Cartesian3> |
<optional> |
一个属性,指定 PolygonHierarchy。 |
|
height |
Property | number |
<optional> |
0 | 一个数值属性,指定多边形相对于椭球表面的高度。 |
heightReference |
Property | HeightReference |
<optional> |
HeightReference.NONE | 一个属性,指定高度所相对的对象。 |
extrudedHeight |
Property | number |
<optional> |
一个数值属性,指定多边形拉伸面相对于椭球表面的高度。 | |
extrudedHeightReference |
Property | HeightReference |
<optional> |
HeightReference.NONE | 一个属性,指定 extrudedHeight 所相对的对象。 |
stRotation |
Property | number |
<optional> |
0.0 | 一个数值属性,指定多边形纹理从正北方向逆时针旋转的角度。仅当未定义 textureCoordinates 时生效。 |
granularity |
Property | number |
<optional> |
Cesium.Math.RADIANS_PER_DEGREE | 一个数值属性,指定每个经纬度点之间的角距离。 |
fill |
Property | boolean |
<optional> |
true | 一个布尔属性,指定多边形是否使用所提供的材质进行填充。 |
material |
MaterialProperty | Color |
<optional> |
Color.WHITE | 一个属性,指定用于填充多边形的材质。 |
outline |
Property | boolean |
<optional> |
false | 一个布尔属性,指定多边形是否带有轮廓。 |
outlineColor |
Property | Color |
<optional> |
Color.BLACK | 一个属性,指定轮廓的 Color。 |
outlineWidth |
Property | number |
<optional> |
1.0 | 一个数值属性,指定轮廓的宽度。 |
perPositionHeight |
Property | boolean |
<optional> |
false | 一个布尔值,指定是否使用每个位置的高度。 |
closeTop |
boolean | boolean |
<optional> |
true | 当为 false 时,拉伸多边形的顶部保持敞开。 |
closeBottom |
boolean | boolean |
<optional> |
true | 当为 false 时,拉伸多边形的底部保持敞开。 |
arcType |
Property | ArcType |
<optional> |
ArcType.GEODESIC | 多边形边缘必须遵循的线的类型。 |
shadows |
Property | ShadowMode |
<optional> |
ShadowMode.DISABLED | 一个枚举属性,指定多边形是否投射或接收来自光源的阴影。 |
distanceDisplayCondition |
Property | DistanceDisplayCondition |
<optional> |
一个属性,指定此多边形将在距离相机多远时显示。 | |
classificationType |
Property | ClassificationType |
<optional> |
ClassificationType.BOTH | 一个枚举属性,指定当此多边形位于地面上时,它将对地形、3D Tiles 还是两者进行分类。 |
zIndex |
ConstantProperty | number |
<optional> |
0 | 一个属性,指定用于对地面几何图形进行排序的 zIndex。仅当多边形为常量且未指定 height 或 extrudedHeight 时生效。 |
textureCoordinates |
Property | PolygonHierarchy |
<optional> |
一个属性,指定纹理坐标,形式为 PolygonHierarchy 的 Cartesian2 点。对地面图元无效。 |
