描述
Rectangle 的图形。
矩形贴合地球曲率,可以放置在表面或指定高度,并可选择性地拉伸为体积。
| Name | Type | Description |
|---|---|---|
options |
RectangleGraphics.ConstructorOptions | optional 描述初始化选项的对象 |
Demo:
See:
Members
classificationType : Property|undefined
获取或设置
ClassificationType 属性,指定此矩形在贴地时是否对地形、3D Tiles 或两者进行分类。
-
Default Value:
ClassificationType.BOTH
coordinates : Property|undefined
获取或设置指定
Rectangle 的属性。
readonly definitionChanged : Event
获取当属性或子属性更改或修改时引发的事件。
distanceDisplayCondition : Property|undefined
获取或设置
DistanceDisplayCondition 属性,指定从相机多远距离显示此矩形。
extrudedHeight : Property|undefined
获取或设置数值属性,指定矩形拉伸的高度。
设置此属性会创建从 height 开始到此高度的体。
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
获取或设置指定用于填充矩形的材质的属性。
-
Default Value:
Color.WHITE
outline : Property|undefined
获取或设置指定矩形是否有轮廓的属性。
-
Default Value:
false
outlineColor : Property|undefined
获取或设置指定轮廓
Color 的属性。
-
Default Value:
Color.BLACK
outlineWidth : Property|undefined
获取或设置数值属性,指定轮廓宽度。
注意:Windows 平台上的所有主流浏览器都会忽略此属性。详情请参见 https://github.com/CesiumGS/cesium/issues/40。
-
Default Value:
1.0
rotation : Property|undefined
获取或设置数值属性,指定矩形从北向顺时针旋转的角度。
-
Default Value:
0
shadows : Property|undefined
获取或设置枚举属性,指定矩形是否从光源投射或接收阴影。
-
Default Value:
ShadowMode.DISABLED
show : Property|undefined
获取或设置指定矩形可见性的布尔属性。
-
Default Value:
true
stRotation : Property|undefined
获取或设置数值属性,指定矩形纹理从北向逆时针旋转的角度。
-
Default Value:
0
zIndex : ConstantProperty|undefined
获取或设置 zIndex 属性,指定矩形的排序顺序。仅在矩形为常量且未指定 height 或 extrudedHeight 时有效。
-
Default Value:
0
Methods
clone(result) → RectangleGraphics
复制此实例。
| Name | Type | Description |
|---|---|---|
result |
RectangleGraphics | optional 用于存储结果的object。 |
Returns:
修改后的结果参数,如果未提供则返回新实例。
将此对象上每个未赋值的属性设置为提供的源对象上相同属性的值。
| Name | Type | Description |
|---|---|---|
source |
RectangleGraphics | 要合并到此对象中的对象。 |
Type Definitions
RectangleGraphics 构造函数的初始化选项
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
show |
Property | boolean |
<optional> |
true | 布尔属性,指定矩形的可见性。 |
coordinates |
Property | Rectangle |
<optional> |
指定 Rectangle 的属性。 |
|
height |
Property | number |
<optional> |
0 | 数值属性,指定相对于椭球表面的矩形高度。 |
heightReference |
Property | HeightReference |
<optional> |
HeightReference.NONE | 指定高度参考系的属性。 |
extrudedHeight |
Property | number |
<optional> |
数值属性,指定矩形拉伸面相对于椭球表面的高度。 | |
extrudedHeightReference |
Property | HeightReference |
<optional> |
HeightReference.NONE | 指定拉伸高度参考系的属性。 |
rotation |
Property | number |
<optional> |
0.0 | 数值属性,指定矩形从北向顺时针旋转的角度。 |
stRotation |
Property | number |
<optional> |
0.0 | 数值属性,指定矩形纹理从北向逆时针旋转的角度。 |
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 | 数值属性,指定轮廓宽度。 |
shadows |
Property | ShadowMode |
<optional> |
ShadowMode.DISABLED | 枚举属性,指定矩形是否从光源投射或接收阴影。 |
distanceDisplayCondition |
Property | DistanceDisplayCondition |
<optional> |
指定从相机多远距离显示此矩形的属性。 | |
classificationType |
Property | ClassificationType |
<optional> |
ClassificationType.BOTH | 枚举属性,指定此矩形在贴地时是否对地形、3D Tiles 或两者进行分类。 |
zIndex |
Property | number |
<optional> |
0 | 指定用于排序地面几何体的 zIndex 的属性。仅在矩形为常量且未指定 height 或 extrudedHeight 时有效。 |
