new GeoBoundary(Obj, south, east, north)
代表世界座標的一個範圍,內部包含west,south,east,north 4個屬性
| Name | Type | Description |
|---|---|---|
Obj |
GeoBoundary | Number | undefined | Array.<Number> |
為west,或本身就是一個GeoBoundary。 |
south |
Number | undefined |
若Obj參數為west使用,否則此參數無意義。 |
east |
Number | undefined |
若Obj參數為west使用,否則此參數無意義。 |
north |
Number | undefined |
若Obj參數為west使用,否則此參數無意義。 |
Example
var a = new GeoBoundary({west:0,south:0,east:0,north:0});
var b = new GeoBoundary(0,0,0,0);
var c = new GeoBoundary();
Members
-
readonlyCenter
-
中心點
Properties:
Name Type Description CenterGeoPoint 中心點
-
eastdouble
-
東邊
-
readonlyHeight
-
高度
Properties:
Name Type Description HeightNumber 高度
-
readonlyIsEmpty
-
是否為空的,空的是指Width === 0 || Height = 0
Properties:
Name Type Description IsEmptyBoolean 是否為空的
-
northdouble
-
北邊
-
southdouble
-
南邊
-
readonlytype
-
物件型態,值為GEO_TYPE.RECT
Properties:
Name Type Description typeGEO_TYPE 物件型態
-
westdouble
-
西邊
-
readonlyWidth
-
寬度
Properties:
Name Type Description WidthNumber 寬度
Methods
-
staticGeoBoundary.IntersectRect(Rect1, Rect2){GeoBoundary|null}
common/Geometry.js, line 3610 -
計算Rect1與Rect2的交集。
Name Type Description Rect1GeoBoundary 要計算的Rect。
Rect2GeoBoundary 要計算的Rect。
Returns:
Type Description GeoBoundary | null 傳回兩Rect的交集,若沒交集,傳回null。 -
Clone(){GeoBoundary}
common/Geometry.js, line 3381 -
產生一份新的自己。
Returns:
Type Description GeoBoundary 傳回複製的新的自己。 -
ContractionToInteger()
common/Geometry.js, line 3780 -
由於座標會有小數,本函式將往內縮,直至座標值為整數為止。
-
CopyFrom(Obj, south, east, north){GeoBoundary}
common/Geometry.js, line 3393 -
複製。
Name Type Description ObjGeoBoundary | Number 為west,或本身就是一個GeoBoundary,或本身就是一個Array。
southNumber 若Obj參數為west使用,否則此參數無意義。
eastNumber 若Obj參數為west使用,否則此參數無意義。
northNumber 若Obj參數為west使用,否則此參數無意義。
Returns:
Type Description GeoBoundary 傳回this。 -
Deflate(DeltaX, DeltaY)
common/Geometry.js, line 3717 -
以中心點,向內縮。
Name Type Description DeltaXNumber west與east都往內縮DeltaX。
DeltaYNumber south與north都往內縮DeltaY。
-
Expand(p)
common/Geometry.js, line 3454 -
使用一個點拓展Boundary。
Name Type Description pGeoPoint 輸入的點。
-
ExpandToInteger()
common/Geometry.js, line 3757 -
由於座標會有小數,本函式將往外擴張,直至座標值為整數為止。
-
ExpandXY(x, y)
common/Geometry.js, line 3466 -
使用一個點的xy值拓展Boundary。
Name Type Description xNumber 輸入的點的x。
yNumber 輸入的點的y。
-
FromGeoJSON(src){Boolean}
common/Geometry.js, line 3819 -
讀入GeoJSON數值。
Name Type Description srcObject | String GeoJSON物件或字串 。
Returns:
Type Description Boolean 回傳讀取是否成功。 -
Include(Rect){Boolean}
common/Geometry.js, line 3625 -
是否完全包含Rect。
Name Type Description RectGeoBoundary 要被包含的Rect。
Returns:
Type Description Boolean 傳回是否完全包含Rect。 -
Inflate(DeltaX, DeltaY)
common/Geometry.js, line 3729 -
以中心點,向外擴張。
Name Type Description DeltaXNumber west與east都向外擴張DeltaX。
DeltaYNumber south與north都向外擴張DeltaY。
-
IntersectRect(Rect1, Rect2){Boolean}
common/Geometry.js, line 3509 -
有兩種用法
檢查自己是否和Rect1相交,用GeoBoundary.IntersectRect(Rect1);
檢查Rect1與Rect2是否相交,若相交,把相交的範圍設定給自己,用GeoBoundary.IntersectRect(Rect1,Rect2);。Name Type Description Rect1GeoBoundary 檢查的Rect。
Rect2GeoBoundary | undefined 檢查的Rect。
Returns:
Type Description Boolean 傳回檢查的結果。 -
IsEqual(Boundary){Boolean}
common/Geometry.js, line 3420 -
是否相等。
Name Type Description BoundaryGeoBoundary 比較的Boundary。
Returns:
Type Description Boolean 傳回比較的結果。 -
IsNotEqual(Boundary){Boolean}
common/Geometry.js, line 3429 -
是否不相等。
Name Type Description BoundaryGeoBoundary 比較的Boundary。
Returns:
Type Description Boolean 傳回比較的結果。 -
OffsetByXY(DeltaX, DeltaY)
common/Geometry.js, line 3741 -
整個GeoBoundary位移(DeltaX,DeltaY)。
Name Type Description DeltaXNumber 水平位移。
DeltaYNumber 垂直位移。
-
PtInRect(p){Boolean}
common/Geometry.js, line 3487 -
檢查p是否位於Rect範圍內
Name Type Description pGeoPoint 檢查的值。
Returns:
Type Description Boolean 傳回檢查的結果。 -
PtXYInRect(p){Boolean}
common/Geometry.js, line 3478 -
檢查p是否位於Rect範圍內
Name Type Description pGeoPoint 檢查的值。
Returns:
Type Description Boolean 傳回檢查的結果。 -
Scale(scale)
common/Geometry.js, line 3703 -
以中心點,對Width與Height縮放scale。
Name Type Description scaleNumber 縮放的倍數。
-
SetNegativeInfinity()
common/Geometry.js, line 3443 -
將Boundary設為負無窮大(不合理的值)。
-
SetNULL()
common/Geometry.js, line 3436 -
將west,south,east,north都設為0。
-
ToArray(){Array.<Number>}
common/Geometry.js, line 3373 -
回傳陣列[W,S,E,N]。
Returns:
Type Description Array.<Number> 陣列[W,S,E,N]。 -
ToGeoJSON(toString){Object|String}
common/Geometry.js, line 3805 -
將幾何輸出成GeoJSON物件或字串。
Name Type Description toStringBoolean 是否把物件轉成JSON字串。
Returns:
Type Description Object | String 輸出轉換結果。 -
Union(Rect)
common/Geometry.js, line 3665 -
計算聯集。
Name Type Description RectGeoBoundary 聯集的對象。