MarkPolygon

MarkPolygon

多边形(支持带孔),符合地球曲率,可放置在椭球表面或将其挤出成一个体。

Constructor

new MarkPolygon(options)

Author:
  • wsy
Example
var position = [];
position[0] = new GeoPosition(-105.0, 39.0,80000);
position[1] = new GeoPosition(-105.0, 31.0,50000);
position[2] = new GeoPosition(-100.0, 31.0,30000);
position[3] = new GeoPosition(-100.0, 39.0,10000);
var polygon = new MarkPolygon({
     positions : position,
     distanceDisplayCondition : new Cesium.DistanceDisplayCondition(0.0, 10000000),
     material : Cesium.Color.RED,
});
Parameters:
Name Type Description
options Object 拥有以下属性的对象:
Properties
Name Type Attributes Default Description
id String <optional>
指定标绘的唯一标识符。如果没有提供,则生成GUID。
name String <optional>
"" 指定标绘的名称,名称不必是唯一的。
show Boolean <optional>
true 指定标绘的可见性。
allowPicking Boolean <optional>
false 指定标绘是否可选中。
availability Cesium.TimeIntervalCollection <optional>
指定标绘在某段时间可用。
description String | Map <optional>
"" 指定描述这个标绘的HTML或Map键值对。
viewFrom Cesium.Cartesian3 <optional>
用于查看该标绘的建议初始偏移量。
distanceDisplayCondition Cesium.DistanceDisplayCondition <optional>
指定在距像机的某个距离内显示此标绘。
material MarkMaterial | Cesium.Color <optional>
Cesium.Color.WHITE 指定标绘的材质。
positions Array.<GeoPosition> 位置数组。
granularity Number <optional>
Cesium.Math.RADIANS_PER_DEGREE 指定每个纬度和经度点之间的角度距离。
fill Boolean <optional>
true 指定是否使用提供的材质填充。
outline Boolean <optional>
false 是否显示边框。
outlineWidth Number <optional>
1.0 边框宽度。
classificationType Cesium.ClassificationType <optional>
Cesium.ClassificationType.BOTH 指定将它贴到地形,3D Tiles上或者两者都贴。
shadows Cesium.ShadowMode <optional>
Cesium.ShadowMode.DISABLED 从每个光源投射或接收阴影的模式。
zIndex Number <optional>
0 指定用于排序地面几何的zIndex。只有当该对象是恒定的且没有高度才有效。
holes Array.<Cesium.PolygonHierarchy> <optional>
用于定义孔洞的层次结构。
height Number <optional>
0 多边形相对于椭球面的高度。
heightReference Cesium.HeightReference <optional>
Cesium.HeightReference.NONE 相对于地形的位置。
extrudedHeight Number <optional>
多边形的挤出高度。
extrudedHeightReference Cesium.HeightReference <optional>
Cesium.HeightReference.NONE 挤出高度相对于地形的位置。
stRotation Number <optional>
0.0 纹理逆时针旋转角(相对于正北方向)。
perPositionHeight Boolean <optional>
false 是否单独使用对象的高度,也就是每个节点的高度可显示,这样可以做一个倾斜的平面。
closeTop Boolean <optional>
true 挤出的时候顶部是否封口。
closeBottom Boolean <optional>
true 挤出的时候底部是否封口。
arcType Cesium.ArcType <optional>
Cesium.ArcType.GEODESIC 多边形边缘线型。

Extends

Members

allowPicking :Boolean

Overrides:
获取或设置标绘是否可选中。
Type:
  • Boolean

arcType :Cesium.ArcType

Default Value:
  • Cesium.ArcType.GEODESIC
获取或设置多边形边缘线型。
Type:
  • Cesium.ArcType

availability :Cesium.TimeIntervalCollection

Overrides:
在指定的时间里可用。
Type:
  • Cesium.TimeIntervalCollection

(readonly) boundingSphereShow :Boolean

Overrides:
Default Value:
  • false
获取是否显示包围球。
Type:
  • Boolean

classificationType :Cesium.ClassificationType

Overrides:
Default Value:
  • Cesium.ClassificationType.BOTH
获取或设置贴到地形,3D Tiles上或者两者都贴。
Type:
  • Cesium.ClassificationType

closeBottom :Boolean

Default Value:
  • true
获取或设置多边形挤出的时候底部是否封口。
Type:
  • Boolean

closeTop :Boolean

Default Value:
  • true
获取或设置多边形挤出的时候顶部是否封口。
Type:
  • Boolean

description :String|Map

Overrides:
Default Value:
  • ""
获取或设置描述这个标绘的HTML或Map键值对。
Type:
  • String | Map

distanceDisplayCondition :Cesium.DistanceDisplayCondition

Overrides:
在距像机的某个距离内显示。
Type:
  • Cesium.DistanceDisplayCondition

extrudedHeight :Number

获取或设置多边形挤出高度。
Type:
  • Number

extrudedHeightReference :Cesium.HeightReference

Default Value:
  • Cesium.HeightReference.NONE
获取或设置多边形挤出高度相对于地形的位置。
Type:
  • Cesium.HeightReference

fill :Boolean

Overrides:
Default Value:
  • true
获取或设置是否使用提供的材质填充。
Type:
  • Boolean

granularity :Number

Overrides:
Default Value:
  • Cesium.Math.RADIANS_PER_DEGREE
获取或设置每个纬度和经度点之间的角度距离。
Type:
  • Number

height :Number

Default Value:
  • 0
获取或设置多边形相对于椭球面的高度。
Type:
  • Number

heightReference :Cesium.HeightReference

Default Value:
  • Cesium.HeightReference.NONE
获取或设置多边形相对于地形的位置。
Type:
  • Cesium.HeightReference

holes :Array.<Cesium.PolygonHierarchy>

获取或设置用于定义孔洞的层次结构。必须为数组类型。
Type:
  • Array.<Cesium.PolygonHierarchy>

(readonly) id :String

Overrides:
获取标绘实体的ID。
Type:
  • String

material :MarkMaterial|Cesium.Color

Overrides:
Default Value:
  • Cesium.Color.WHITE
获取或设置标绘的材质。
Type:

name :String

Overrides:
获取或设置标绘实体的名称。
Type:
  • String

outline :Boolean

Overrides:
Default Value:
  • false
获取或设置是否显示边框。
Type:
  • Boolean

outlineColor :Cesium.Color

Overrides:
Default Value:
  • Cesium.Color.BLACK
获取或设置边框颜色。
Type:
  • Cesium.Color

outlineWidth :Number

Overrides:
Default Value:
  • 1.0
获取或设置边框宽度。
Type:
  • Number

perPositionHeight :Boolean

Default Value:
  • false
获取或设置多边形是否单独使用每个位置的高度,这样可以做一个倾斜的平面。
Type:
  • Boolean

positions :Array.<GeoPosition>

Overrides:
获取或设置多边形位置数组。
Type:

ready

Overrides:
获取是否已经准备就绪好下一次渲染。

shadows :Cesium.ShadowMode

Overrides:
Default Value:
  • Cesium.ShadowMode.DISABLED
获取或设置从每个光源投射或接收阴影的模式。
Type:
  • Cesium.ShadowMode

show :Boolean

Overrides:
Default Value:
  • true
获取或设置标绘实体的显示或隐藏。
Type:
  • Boolean

stRotation :Number

Default Value:
  • 0.0
获取或设置多边形纹理逆时针旋转角(相对于正北方向)。
Type:
  • Number

viewFrom :Cesium.Cartesian3

Overrides:
Default Value:
  • undefined
查看该标绘实例的建议初始偏移量。
Type:
  • Cesium.Cartesian3

zIndex :Number

Overrides:
Default Value:
  • 0
获取或设置用于排序地面几何的zIndex。只有当该对象是恒定的且没有高度才有效。
Type:
  • Number

Methods

getBoundingSphere(viewer) → {Cesium.BoundingSphere}

Overrides:
获取此标绘实例的包围球。使用时必须调用getReadyPromise()方法。
Example
// box为已经创建好的Mark
box.getReadyPromise(viewer).then(function(box){
     console.log(box.getBoundingSphere(viewer));
})
Parameters:
Name Type Description
viewer Cesium.Viewer Cesium可视化器。
Returns:
获取的包围球。
Type
Cesium.BoundingSphere

getReadyPromise(viewer) → {Promise.Mark}

Overrides:
获取ReadyPromise
Parameters:
Name Type Description
viewer Cesium.Viewer
Returns:
Type
Promise.Mark

showBoundingSphere(viewer, show)

Overrides:
设置是否显示包围球。
Parameters:
Name Type Description
viewer Cesium.Viewer Cesium可视化器。
show Boolean 是否显示包围球。