<< Click to Display Table of Contents >>
new sg.geometry.Polygon()
Description
建立一個多邊形物件
Position
Geometry.js
Properties
Properties |
Type |
Description |
extent |
sg.geometry.Extent |
幾何資料範圍 |
type |
String |
幾何資料的類型 |
area |
Number |
多邊形面積 |
rings |
Array.<sg.geometry.LinearRing> |
多邊形環的陣列 |
Methods
Methods |
Type |
Description |
||||||||||
getExtent() |
Returns: sg.geometry.Extent |
取得幾何資料範圍 Returns:
|
||||||||||
toWkt() |
Returns: String |
轉換成wkt字串 Returns:
|
||||||||||
addRing(ring) |
sg.geometry.LinearRing |
在多邊形加入環
|
||||||||||
contains(pt) |
pt:sg.geometry.Point Returns:Boolean |
判斷一個點是否與多邊形相交
Returns:
|
||||||||||
getArea() |
Returns: Number |
取得多邊形面積 Returns:
|
||||||||||
getCentroid() |
Returns: sg.geometry.Point |
取得多邊形的重心 Returns:
|
||||||||||
isClockwise(ring) |
ring:sg.geometry.LinearRing Returns:Boolean |
判斷一個環的方向是否為順時鐘方向
Returns:
|
||||||||||
update() |
更新多邊形的範圍、面積等等屬性 |
|||||||||||
Clone()
|
Returns: sg.geometry.Polygon |
複製多邊形幾何物件並回傳 Returns:
|
||||||||||
transform(a,b,c,d,e,f,g,h,i) |
Number |
透過轉換參數,對多邊形幾何物件進行座標轉換
|
||||||||||
forEachVertex(callback) |
function |
透過callback方法,回傳多邊形幾何物件的所有頂點資料 callback(context) { //頂點資料 (sg.geometry.Point) context.point; //環陣列索引值 context.ringIndex; //頂點資料索引值 context.pointIndex; } |
||||||||||
getFirstPoint_
|
Returns: sg.geometry.point |
取得多邊形幾何物件的第一個點位 Returns:
|
Example
|
©2015 Supergeo Technologies Inc.