new GeoPolygonSet(obj)
建立複合多邊形
Name | Type | Description |
---|---|---|
obj |
GeoPolygonSet | GeoPolygon | GeoBoundary |
optional
欲複製的GeoPolygonSet;欲轉換的GeoPolygon;欲轉換的GeoBoundary。 |
Example
var a = new GeoPolygonSet();//預設建構子
var b = new GeoPolygonSet(a);//使用欲複製的GeoPolygonSet建立GeoPolygonSet
var c = new GeoPolygonSet(new GeoPolygon());//使用欲轉換的GeoPolygon建立GeoPolygonSet
var d = new GeoPolygonSet(new GeoBoundary());//使用欲轉換的GeoBoundary建立GeoPolygonSet
Extends
Members
-
readonlyBoundary
-
此幾何的範圍
Properties:
Name Type Description Boundary
GeoBoundary 範圍
-
Bounds
-
放置外圍Polygon的Buffer
Properties:
Name Type Description Bounds
Array.<GeoPolygon> 點位陣列
-
readonlyCenter
-
此幾何的中心點
Properties:
Name Type Description Center
GeoPoint 中心點
-
HolesArray.<GeoPolygon>
-
放置洞Polygon的Buffer
-
PointCount
-
內含點位的數量
Properties:
Name Type Description PointCount
Number 點位的數量
-
readonlytype
-
物件型態,值為GEO_TYPE.POLYGONSET
Properties:
Name Type Description type
GEO_TYPE 物件型態
Methods
-
Clone(){GeoPolyline}
common/Geometry.js, line 7573 -
產生一份新的自己。
Returns:
Type Description GeoPolyline 傳回複製的新的自己。 -
CombinPolygonSet(polygonSet, retPolygonSet, combineType){Boolean}
common/Geometry.js, line 7609 -
將自己與傳入的PolygonSet做合併運算。
Name Type Description polygonSet
GeoPolygonSet 運算的PolygonSet資料。
retPolygonSet
GeoPolygonSet 此為out參數,需先在外面配好變數,合併後的結果。
combineType
GEO_CB_TYPE 運算類型。
Returns:
Type Description Boolean 傳回運算是否成功 -
CopyFrom(obj){GeoPolygonSet}
common/Geometry.js, line 7581 -
複製。
Name Type Description obj
GeoPolygon | GeoPolygonSet 複製的資料源。
Returns:
Type Description GeoPolygonSet this。 -
Distance(obj){Number}
common/Geometry.js, line 7917 -
計算自己與傳入幾何的距離。
Name Type Description obj
GeoPoint | GeoLine | GeoPolyline | GeoPolygon | GeoPolygonSet 要計算距離的幾何資料。
Returns:
Type Description Number 傳回距離。 -
FromGeoJSON(src){Boolean}
common/Geometry.js, line 8085 -
讀入GeoJSON數值。
Name Type Description src
Object | String GeoJSON物件或字串 。
Returns:
Type Description Boolean 回傳讀取是否成功。 -
GetArea(){Number}
common/Geometry.js, line 7632 -
計算此PolygonSet的面積。
Returns:
Type Description Number 傳回計算的面積。 -
Include(obj, bound){Boolean}
common/Geometry.js, line 7811 -
判斷傳入的幾何資料是否被自己包含。
Name Type Description obj
GeoPoint | GeoLine | GeoPolyline | GeoPolygon | GeoPolygonSet 判斷的幾何資料。
bound
Boolean 只用於Polygon與PolygonSet,指示相交於邊上是否算包含。
Returns:
Type Description Boolean 傳回是否包含。 -
IsIntersect(obj, slice){Boolean}
common/Geometry.js, line 7702 -
判斷自己與傳入幾何是否相交。
Name Type Description obj
GeoPolyline | GeoPolygon | GeoPolygonSet 判斷的幾何資料。
slice
Boolean 指定若只交在節點上,算不算相交。
Returns:
Type Description Boolean 傳回是否相交。 -
MakeBuffer(distance, polygonSet){Boolean}
common/Geometry.js, line 7984 -
做出環域的PolygonSet。
Name Type Description distance
Number 環域的距離。
polygonSet
GeoPolygonSet out參數,環域計算的答案。
Returns:
Type Description Boolean 回傳是否成功。 -
Offset(p)
common/Geometry.js, line 7965 -
位移p。
Name Type Description p
GeoPoint 欲位移的距離。
-
PtInPolygonSet(p, obj){Boolean}
common/Geometry.js, line 7940 -
檢查傳入的點p是否位於此PolygonSet內。
Name Type Description p
GeoPoint 欲檢查的點。
obj
Object 此為out參數,需在執行前先配置好,執行後,Obj.InBound=true|false代表是否位於邊緣上。
Returns:
Type Description Boolean 傳回是否位於PolygonSet內。 -
RemoveAll()
common/Geometry.js, line 7598 -
移除所有的點位資料。
-
ToGeoBuffer(){Array}
common/Geometry.js, line 8164 -
輸出成緩衝區物件。
Returns:
Type Description Array 回傳多邊形集合緩衝區陣列。 -
ToGeoJSON(toString, includeZ){Object|String}
common/Geometry.js, line 8015 -
將幾何輸出成GeoJSON物件或字串。
Name Type Default Description toString
Boolean 是否把物件轉成JSON字串。
includeZ
Boolean false 是否包含Z,標準GeoJSON不包含Z(可不給,預設false)。
Returns:
Type Description Object | String 輸出轉換結果。