Class: GeoPoint

GeoPoint

幾何物件:點

new GeoPoint(obj, y, z)

common/Geometry.js, line 3862

建立點

Name Type Description
obj GeoPoint | Number | Object optional

欲複製的GeoPoint;指定的x;帶有x,y(,z)的Object。

y Number optional

指定的y。

z Number optional

指定的z。

Example

var a = new GeoPoint();//預設建構子
var b = new GeoPoint(a);//使用欲複製的GeoPoint建立GeoPoint
var c = new GeoPoint(0, 0);//指定x,y建立GeoPoint
var d = new GeoPoint(0, 0, 0);//指定x,y,z建立GeoPoint
var e = new GeoPoint({x:0, y:0});//使用帶有x,y的Object建立GeoPoint
var f = new GeoPoint({x:0, y:0, z:0});//使用帶有x,y,z的Object建立GeoPoint

Extends

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 4077

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

Name Type Description
line GeoLine

要相對的Line。

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

Clone(){GeoPoint}

common/Geometry.js, line 3956

產生一份新的自己。

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

CopyFrom(obj, y, z){GeoPoint}

common/Geometry.js, line 3966

複製。

Name Type Description
obj GeoPoint | number

複製的GeoPoint或x。

y number optional

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

z number optional

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

Returns:
Type Description
GeoPoint this。

Distance(obj){Number}

common/Geometry.js, line 4102

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

Name Type Description
obj GeoPoint | GeoPolyline | GeoPolygon | GeoPolygonSet

要計算距離的幾何資料。

Returns:
Type Description
Number 傳回距離。

Div(div){GeoPoint}

common/Geometry.js, line 4059

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

Name Type Description
div Number

要除的值。

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

DivSelf(div){GeoPoint}

common/Geometry.js, line 4067

將自己的座標除以div。

Name Type Description
div Number

要除的值。

Returns:
Type Description
GeoPoint this。

FromGeoJSON(src){Boolean}

common/Geometry.js, line 4207

讀入GeoJSON數值。

Name Type Description
src Object | String

GeoJSON物件或字串。

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

IsEqual(p){Boolean}

common/Geometry.js, line 3989

是否相等。

Name Type Description
p GeoPoint

比較的point。

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

IsNotEqual(p){Boolean}

common/Geometry.js, line 3997

是否不相等。

Name Type Description
p GeoPoint

比較的point。

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

MakeBuffer(delta, polygonSet){Boolean}

common/Geometry.js, line 4133

做出環域的PolygonSet。

Name Type Description
delta Number

環域的距離。

polygonSet GeoPolygonSet

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

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

Mul(scale){GeoPoint}

common/Geometry.js, line 4041

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

Name Type Description
scale Number

要乘的值。

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

MulSelf(scale){GeoPoint}

common/Geometry.js, line 4049

將自己的座標乘上Scale。

Name Type Description
scale Number

要乘的值。

Returns:
Type Description
GeoPoint this。

Normalize(){GeoPoint}

common/Geometry.js, line 4140

把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 4005

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

Name Type Description
p GeoPoint

要計算的point。

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

PlusSelf(p){GeoPoint}

common/Geometry.js, line 4013

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

Name Type Description
p GeoPoint

要計算的point。

Returns:
Type Description
GeoPoint this。

Rotate(angle, wrtPoint){GeoPoint}

common/Geometry.js, line 4155

旋轉。

Name Type Default Description
angle Number

旋轉的角度。

wrtPoint GeoPoint | undefined null

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

Returns:
Type Description
GeoPoint this。

Sub(p){GeoPoint}

common/Geometry.js, line 4023

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

Name Type Description
p GeoPoint

要計算的point。

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

SubSelf(p){GeoPoint}

common/Geometry.js, line 4031

將自己座標減去point。

Name Type Description
p GeoPoint

要計算的point。

Returns:
Type Description
GeoPoint this。

ToGeoJSON(toString, includeZ){Object|String}

common/Geometry.js, line 4185

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

Name Type Description
toString Boolean

是否把物件轉成JSON字串。

includeZ Boolean

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

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

toString(){string}

common/Geometry.js, line 4176

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

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