橢球上多邊形輪廓的描述。多邊形由多邊形層次定義。
new PolygonOutlineGeometry(options)
Parameters:
options
(Object)
Name | Description |
---|---|
options.polygonHierarchy
PolygonHierarchy
|
包含孔的多邊形層次結(jié)構(gòu)。 |
options.height
Number
default 0.0
|
多邊形與橢球面之間的距離,單位為米。 |
options.extrudedHeight
Number
|
多邊形的擠壓面和橢球面之間的距離,單位為米。 |
options.vertexFormat
VertexFormat
default VertexFormat.DEFAULT
|
要計(jì)算的頂點(diǎn)屬性。 |
options.ellipsoid
Ellipsoid
default Ellipsoid.WGS84
|
用作參考的橢球體。 |
options.granularity
Number
default BMMath.RADIANS_PER_DEGREE
|
每一緯度和經(jīng)度之間的距離,以弧度表示。確定緩沖區(qū)中的位置數(shù)。 |
options.perPositionHeight
Boolean
default false
|
對(duì)每個(gè)位置使用options.positions的高度,而不是使用options.height來(lái)確定高度。 |
options.arcType
ArcType
default ArcType.GEODESIC
|
大綱必須遵循的路徑類型。有效選項(xiàng)為ArcType.GEODESIC 和ArcType.RHUMB 。
|
Example
// 1. create a polygon outline from points
var polygon = new bmgl.PolygonOutlineGeometry({
polygonHierarchy : new bmgl.PolygonHierarchy(
bmgl.Cartesian3.fromDegreesArray([
-72.0, 40.0,
-70.0, 35.0,
-75.0, 30.0,
-70.0, 30.0,
-68.0, 40.0
])
)
});
var geometry = bmgl.PolygonOutlineGeometry.createGeometry(polygon);
// 2. create a nested polygon with holes outline
var polygonWithHole = new bmgl.PolygonOutlineGeometry({
polygonHierarchy : new bmgl.PolygonHierarchy(
bmgl.Cartesian3.fromDegreesArray([
-109.0, 30.0,
-95.0, 30.0,
-95.0, 40.0,
-109.0, 40.0
]),
[new bmgl.PolygonHierarchy(
bmgl.Cartesian3.fromDegreesArray([
-107.0, 31.0,
-107.0, 39.0,
-97.0, 39.0,
-97.0, 31.0
]),
[new bmgl.PolygonHierarchy(
bmgl.Cartesian3.fromDegreesArray([
-105.0, 33.0,
-99.0, 33.0,
-99.0, 37.0,
-105.0, 37.0
]),
[new bmgl.PolygonHierarchy(
bmgl.Cartesian3.fromDegreesArray([
-103.0, 34.0,
-101.0, 34.0,
-101.0, 36.0,
-103.0, 36.0
])
)]
)]
)]
)
});
var geometry = bmgl.PolygonOutlineGeometry.createGeometry(polygonWithHole);
// 3. create extruded polygon outline
var extrudedPolygon = new bmgl.PolygonOutlineGeometry({
polygonHierarchy : new bmgl.PolygonHierarchy(
bmgl.Cartesian3.fromDegreesArray([
-72.0, 40.0,
-70.0, 35.0,
-75.0, 30.0,
-70.0, 30.0,
-68.0, 40.0
])
),
extrudedHeight: 300000
});
var geometry = bmgl.PolygonOutlineGeometry.createGeometry(extrudedPolygon);
- PolygonOutlineGeometry#createGeometry
- PolygonOutlineGeometry#fromPositions
See:
Members
packedLength : Number
用于將對(duì)象打包到數(shù)組中的元素?cái)?shù)。
Methods
(static) createGeometry(polygonGeometry) → {Geometry|undefined}
計(jì)算多邊形輪廓的幾何表示,包括頂點(diǎn)、索引和邊界球。
Parameters:
從位置數(shù)組中對(duì)多邊形輪廓的描述。
Parameters:
options
(Object)
Name | Description |
---|---|
options.positions
Array.<Cartesian3>
|
定義多邊形角點(diǎn)的位置數(shù)組。 |
options.height
Number
default 0.0
|
多邊形的高度。 |
options.extrudedHeight
Number
|
多邊形拉伸的高度。 |
options.ellipsoid
Ellipsoid
default Ellipsoid.WGS84
|
用作參考的橢球體。 |
options.granularity
Number
default BMMath.RADIANS_PER_DEGREE
|
每一緯度和經(jīng)度之間的距離,以弧度表示。確定緩沖區(qū)中的位置數(shù)。 |
options.perPositionHeight
Boolean
default false
|
對(duì)每個(gè)位置使用options.positions的高度,而不是使用options.height來(lái)確定高度。 |
options.arcType
ArcType
default ArcType.GEODESIC
|
大綱必須遵循的路徑類型。有效選項(xiàng)為LinkType.GEODESIC 和ArcType.RHUMB 。
|
Example
// create a polygon from points
var polygon = bmgl.PolygonOutlineGeometry.fromPositions({
positions : bmgl.Cartesian3.fromDegreesArray([
-72.0, 40.0,
-70.0, 35.0,
-75.0, 30.0,
-70.0, 30.0,
-68.0, 40.0
])
});
var geometry = bmgl.PolygonOutlineGeometry.createGeometry(polygon);
- PolygonOutlineGeometry#createGeometry
See:
將提供的實(shí)例存儲(chǔ)到提供的數(shù)組中。
Parameters:
array
(Array.<Number>)
要打包的數(shù)組。
startingIndex
(Number)
(default 0
)
數(shù)組中開始打包元素的索引。
從壓縮數(shù)組中檢索實(shí)例。
Parameters:
array
(Array.<Number>)
壓縮數(shù)組。
startingIndex
(Number)
(default 0
)
要解包的元素的起始索引。