Class: GeoPoint

GeoPoint

new GeoPoint(複製的GeoPoint或x。, y, z)

common/Geometry.js, line 3858

幾何物件:點

Name Type Description
複製的GeoPoint或x。 GeoPoint | Number | undefined
y Number | undefined

若Obj參數為x時此參數為y,否則此參數無意義。

z Number | undefined

若有z座標,此代表z座標,否則此參數無意義。

Example

var a = new GeoPoint({x:0,y:0});
var b = new GeoPoint(0,0);
var c = new GeoPoint();
var d = new GeoPoint({x:0,y:0,z:0});
var e = new GeoPoint(0,0,0);
var f = new GeoPoint(new GeoPoint(1,2,3));

Members

Boundary

此幾何的範圍,因為是點,所以範圍的Width與Height都是0

Properties:
Name Type Description
Boundary GeoBoundary

範圍

Length

此點離原點的長度

Properties:
Name Type Description
Length Number

長度

PolarAngle

波拉角,即把此座標當向量,此向量的數學角度,單位為角度

Properties:
Name Type Description
PolarAngle Number

波拉角

readonlytype

物件型態,值為GEO_TYPE.POINT

Properties:
Name Type Description
type GEO_TYPE

物件型態

xdouble

x座標

ydouble

y座標

zdouble

z座標

Methods

Classify(Line){GEO_STATUS}

common/Geometry.js, line 4070

計算自己相關於Line的位置。

Name Type Description
Line GeoLine

要相對的Line。

Returns:
Type Description
GEO_STATUS 傳回自己相關於Line的位置。

Clone(){GeoPoint}

common/Geometry.js, line 3938

產生一份新的自己。

Returns:
Type Description
GeoPoint 傳回複製的新的自己。

CopyFrom(Obj, y){GeoPoint}

common/Geometry.js, line 3948

複製。

Name Type Description
Obj GeoPoint | number

複製的GeoPoint或x。

y Number

若Obj參數為x時此參數為y,否則此參數無意義。

Returns:
Type Description
GeoPoint this。

Distance(Obj){Number}

common/Geometry.js, line 4101

計算自己與傳入幾何的距離。

Name Type Description
Obj GeoPoint | GeoPolyline | GeoPolygon | GeoPolygonSet

要計算距離的幾何資料。

Returns:
Type Description
Number 傳回距離。

Div(div){GeoPoint}

common/Geometry.js, line 4050

將座標除以div,並傳回結果。

Name Type Description
div Number

要除的值。

Returns:
Type Description
GeoPoint 傳回計算的結果。

DivSelf(div){GeoPoint}

common/Geometry.js, line 4059

將自己的座標除以div。

Name Type Description
div Number

要除的值。

Returns:
Type Description
GeoPoint this。

FromGeoJSON(src){Boolean}

common/Geometry.js, line 4211

讀入GeoJSON數值。

Name Type Description
src Object | String

GeoJSON物件或字串。

Returns:
Type Description
Boolean 回傳讀取是否成功。

IsEqual(p){Boolean}

common/Geometry.js, line 3972

是否相等。

Name Type Description
p GeoPoint

比較的point。

Returns:
Type Description
Boolean 傳回比較的結果。

IsNotEqual(p){Boolean}

common/Geometry.js, line 3981

是否不相等。

Name Type Description
p GeoPoint

比較的point。

Returns:
Type Description
Boolean 傳回比較的結果。

MakeBuffer(Delta, PolygonSet){Boolean}

common/Geometry.js, line 4134

做出環域的PolygonSet。

Name Type Description
Delta Number

環域的距離。

PolygonSet GeoPolygonSet

out參數,環域計算的答案。

Returns:
Type Description
Boolean 回傳是否成功。

Mul(Scale){GeoPoint}

common/Geometry.js, line 4030

將座標乘上Scale,並傳回結果。

Name Type Description
Scale Number

要乘的值。

Returns:
Type Description
GeoPoint 傳回計算的結果。

MulSelf(Scale){GeoPoint}

common/Geometry.js, line 4039

將自己的座標乘上Scale。

Name Type Description
Scale Number

要乘的值。

Returns:
Type Description
GeoPoint this。

Normalize(){GeoPoint}

common/Geometry.js, line 4142

把point當向量,座向量的正規化,就是把向量的長度變成1。

Returns:
Type Description
GeoPoint this。

Offset(p)

common/Geometry.js, line 4123

位移,與PlusSelf一樣。

Name Type Description
p GeoPoint

要位移的距離。

Plus(p){GeoPoint}

common/Geometry.js, line 3990

將座標加上point,並傳回結果。

Name Type Description
p GeoPoint

要計算的point。

Returns:
Type Description
GeoPoint 傳回計算的結果。

PlusSelf(p){GeoPoint}

common/Geometry.js, line 3999

將座標加到自己的座標上。

Name Type Description
p GeoPoint

要計算的point。

Returns:
Type Description
GeoPoint this。

Rotate(Angle, wrtPoint){GeoPoint}

common/Geometry.js, line 4158

旋轉。

Name Type Description
Angle Number

旋轉的角度。

wrtPoint GeoPoint | undefined

旋轉的中心點,若wrtPoint=undefined,代表繞著原點旋轉。

Returns:
Type Description
GeoPoint this。

Sub(p){GeoPoint}

common/Geometry.js, line 4010

將座標減去point,並傳回結果。

Name Type Description
p GeoPoint

要計算的point。

Returns:
Type Description
GeoPoint 傳回計算的結果。

SubSelf(p){GeoPoint}

common/Geometry.js, line 4019

將自己座標減去point。

Name Type Description
p GeoPoint

要計算的point。

Returns:
Type Description
GeoPoint this。

ToGeoJSON(toString, includeZ){Object|String}

common/Geometry.js, line 4191

將幾何輸出成GeoJSON物件或字串。

Name Type Description
toString Boolean

是否把物件轉成JSON字串。

includeZ Boolean

是否包含Z,標準GeoJSON不包含Z(可不給,預設false)。

Returns:
Type Description
Object | String 輸出轉換結果。

toString(){string}

common/Geometry.js, line 4181

將座標值轉成字串,格式為(x,y)。

Returns:
Type Description
string 用字串代表此座標。