<< Click to Display Table of Contents >>

SuperGIS Server JavaScript API

 

new sg.symbols.SimpleLineSymbol(style, color, width)

 

 

Description

建立一個(具有參數的)SimpleLineSymbol 物件。

 

Position

Symbol.js

 

 

Parameters

 

Parameter

Type

Description

style

String

符號樣式

(參考Constants列舉定義)

color

sg.Color

符號顏色

width

Number

線寬

 

 

Constants

 

Constants

Description

STYLE_DASH

虛線符號。

STYLE_DASHDOT

虛線-點符號。

STYLE_DASHDOTDOT

虛線-點-點符號。

STYLE_DOT

點符號。

STYLE_LONGDASH

長虛線符號。

STYLE_LONGDASHDOT

長虛線-點符號。

STYLE_NULL

空符號。

STYLE_SHORTDASH

短虛線符號。

STYLE_SHORTDASHDOT

短虛線-點符號。

STYLE_SHORTDASHDOTDOT

短虛線-點-點符號。

STYLE_SHORTDOT

短點符號。

SYLTE_SOLID

實線符號。

 

 

Properties

 

Properties

Type

Description

color

sg.Color

線段符號的顏色

style

String

線段線符號樣式

(參考Constants列舉定義)

width

Number

線的寬度

type

String

符號的類型

 

 

 

Methods

 

Methods

Type

Description

setColor(color)

sg.Color

設定線段符號顏色。

Name

Type

Description

color

sg.Color

符號的顏色

setStyle(style)

String

設定線段符號樣式。

Name

Type

Description

style

String

線符號樣式

setWidth(width)

Number

設定線段符號寬度。

Name

Type

Description

width

Number

線的寬度,單位為pixel

toXml(innerText)

innerText:String

Returns:String

將線段符號轉為xml字串。

Name

Type

Description

innerText

String

symbol的tag 名稱

null: symbol的tag 名稱為"tag"

string: symbol的tag 名稱為"innerText"

Returns:

Type

Description

String

線段符號的xml字串。

 

 

Example

 

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

 

var outline = new sg.symbols.SimpleLineSymbol(sg.symbols.SimpleLineSymbol.STYLE_NULL, new sg.Color(0, 0, 0, 0), 0);

 

 

See live example

 


©2015 Supergeo Technologies Inc.