<< Click to Display Table of Contents >>

SuperGIS Server JavaScript API

 

new sg.geometry.MultiLineString()

 

 

Description

建立多重線段幾何物件

 

Position

Geometry.js

 

 

Properties

 

Properties

Type

Description

extent

sg.geometry.Extent

幾何資料範圍

parts

Array.<sg.geometry.Geometry>

幾何資料陣列

type

String

幾何資料的類型

 

 

Methods

 

Methods

Type

Description

addPart(part)

sg.geometry.Geometry

加入幾何資料到集合裡

Name

Type

Description

part

sg.geometry.Geometry

幾何資料

toWkt()

Returns:

String

轉換成wkt字串

Returns:

Type

Description

String

wkt字串

getExtent()

Returns:

sg.geometry.Extent

取得幾何資料範圍

Returns:

Type

Description

sg.geometry.Extent

幾何範圍

update(updatepart)

sg.geometry.MultiLineString

更新多重幾何線段資料

(更新後,舊資料會被新資料取代)

Name

Type

Description

updatepart

sg.geometry.MultiLineString

幾何線段資料

getFirstPoint_

Returns:

sg.geometry.Point

取得多重線段物件的第一個點位

Returns:

Type

Description

sg.geometry.Point

多重線段物件的第一個點位

getCentroid()        

Returns:

sg.geometry.Point

取得多重線段重心點位

Returns:

Type

Description

sg.geometry.Point

重心點

Clone()        

Returns:

sg.geometry.MultiLineString

複製多重線段幾何物件並回傳

Returns:

Type

Description

sg.geometry.MultiLineString

多重線段幾何物件

transform(a,b,c,d,e,f,g,h,i)

Nmber

透過轉換參數,對multi-part幾何物件進行座標轉換

Name

Type

Description

a,b,c,d,e,f,g,h,i

Nmber

轉換矩陣元素,

轉換矩陣M=[[a, b, c], [d, e, f], [g, h, i]]

forEachVertex(callback)

function

透過callback方法,回傳線段幾何物件的所有頂點資料

callback(context)

{

 //回傳內容,參考linestring

 //forEachVertex(callback)

 //的說明

}

 

 

 

Example

 

 

<script type="text/javascript" src="scripts/Geometry.js"></script>

 

var multiline = new sg.geometry.MultiLineString;

var line1 = new sg.geometry.LineString;        

line1.path.push(new sg.geometry.Point(1628256, 5128329));

line1.path.push(new sg.geometry.Point(2101868, 5163128));

line1.update();

 

var line2 = new sg.geometry.LineString;

line2.path.push(new sg.geometry.Point(2274538, 5546056));

line2.path.push(new sg.geometry.Point(1941530, 5558390));

line2.update();

 

multiline.addPart(line1);

multiline.addPart(line2);

 

 

See live example

 


©2015 Supergeo Technologies Inc.