描述
Rectangle 的图形。
矩形符合地球的曲率,可以放置在地表或高处,并且可以选择性地被拉伸成一个体积。
| Name | Type | Description |
|---|---|---|
options |
RectangleGraphics.ConstructorOptions | optional 描述初始化选项的对象 |
Demo:
See:
Members
classificationType : Property|undefined
获取或设置指定矩形在地面上时是否会对地形、3D Tiles 或两者进行分类的
ClassificationType 属性。
-
Default Value:
ClassificationType.BOTH
coordinates : Property|undefined
获取或设置指定
Rectangle 的属性。
readonly definitionChanged : Event
获取每当属性或子属性被改变或修改时所触发的事件。
distanceDisplayCondition : Property|undefined
获取或设置指定矩形在距相机的距离下显示的
DistanceDisplayCondition 属性。
extrudedHeight : Property|undefined
获取或设置指定矩形拉伸高度的数值属性。
设置此属性将在高度开始并以此高度结束时创建一个体积。
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平台上被忽略。有关详细信息,请参阅 (@link 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 属性,指定矩形的顺序。仅在矩形是常量且未指定高度或拉伸高度时有效。
-
Default Value:
0
Methods
clone(result) → RectangleGraphics
复制此实例。
| Name | Type | Description |
|---|---|---|
result |
RectangleGraphics | optional 存储结果的对象。 |
Returns:
修改后的结果参数,如果未提供,则返回一个新实例。
将此对象上每个未分配的属性赋值为
提供的源对象上相同属性的值。
| Name | Type | Description |
|---|---|---|
source |
RectangleGraphics | 要合并到此对象中的对象。 |
Type Definitions
Initialization options for the RectangleGraphics constructor
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
show |
Property | boolean |
<optional> |
true | A boolean Property specifying the visibility of the rectangle. |
coordinates |
Property | Rectangle |
<optional> |
The Property specifying the Rectangle. |
|
height |
Property | number |
<optional> |
0 | A numeric Property specifying the altitude of the rectangle relative to the ellipsoid surface. |
heightReference |
Property | HeightReference |
<optional> |
HeightReference.NONE | A Property specifying what the height is relative to. |
extrudedHeight |
Property | number |
<optional> |
A numeric Property specifying the altitude of the rectangle's extruded face relative to the ellipsoid surface. | |
extrudedHeightReference |
Property | HeightReference |
<optional> |
HeightReference.NONE | A Property specifying what the extrudedHeight is relative to. |
rotation |
Property | number |
<optional> |
0.0 | A numeric property specifying the rotation of the rectangle clockwise from north. |
stRotation |
Property | number |
<optional> |
0.0 | A numeric property specifying the rotation of the rectangle texture counter-clockwise from north. |
granularity |
Property | number |
<optional> |
Cesium.Math.RADIANS_PER_DEGREE | A numeric Property specifying the angular distance between points on the rectangle. |
fill |
Property | boolean |
<optional> |
true | A boolean Property specifying whether the rectangle is filled with the provided material. |
material |
MaterialProperty | Color |
<optional> |
Color.WHITE | A Property specifying the material used to fill the rectangle. |
outline |
Property | boolean |
<optional> |
false | A boolean Property specifying whether the rectangle is outlined. |
outlineColor |
Property | Color |
<optional> |
Color.BLACK | A Property specifying the Color of the outline. |
outlineWidth |
Property | number |
<optional> |
1.0 | A numeric Property specifying the width of the outline. |
shadows |
Property | ShadowMode |
<optional> |
ShadowMode.DISABLED | An enum Property specifying whether the rectangle casts or receives shadows from light sources. |
distanceDisplayCondition |
Property | DistanceDisplayCondition |
<optional> |
A Property specifying at what distance from the camera that this rectangle will be displayed. | |
classificationType |
Property | ClassificationType |
<optional> |
ClassificationType.BOTH | An enum Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground. |
zIndex |
Property | number |
<optional> |
0 | A Property specifying the zIndex used for ordering ground geometry. Only has an effect if the rectangle is constant and neither height or extrudedHeight are specified. |
