<< Click to Display Table of Contents >>
new sg.geometry.LineString()
Description
建立一個線段物件
Position
Geometry.js
Properties
Properties |
Type |
Description |
extent |
sg.geometry.Extent |
幾何資料範圍 |
type |
String |
幾何資料的類型 |
length |
Number |
線段長度 |
path |
Array.<sg.geometry.Point> |
線段路徑點陣列 |
Methods
Methods |
Type |
Description |
||||||
addPoint(pt) |
sg.geometry.Point |
加入路徑點
|
||||||
toWkt() |
Returns: String |
轉換成wkt字串 Returns:
|
||||||
getExtent() |
Returns: sg.geometry.Extent |
取得幾何資料範圍 Returns:
|
||||||
getLength() |
Returns: Number |
取得線的長度 Returns:
|
||||||
getMidPoint() |
Returns: sg.geometry.Point |
取得線條中點 Returns:
|
||||||
setPath(path) |
Array.<sg.geometry.Point> |
設定線的路徑
|
||||||
update() |
更新線的屬性 |
|||||||
getCentroid()
|
Returns: sg.geometry.Point |
取得線段的重心 Returns:
|
||||||
Clone() |
Returns: sg.geometry.LineString |
複製線段幾何物件並回傳 Returns:
|
||||||
transform(a,b,c,d,e,f,g,h,i)
|
Number |
透過轉換參數,對線段幾何物件進行座標轉換
|
||||||
forEachVertex(callback) |
function |
透過callback方法,回傳線段幾何物件的所有頂點資料 callback(context) { //頂點資料 (sg.geometry.Point) Context.point; //頂點資料索引值 Context.pointIndex; } |
||||||
getFirstPoint_ |
Returns: sg.geometry.point |
取得線段物件的第一個點位 Return:
|
Example
|
©2015 Supergeo Technologies Inc.