<< Click to Display Table of Contents >>

 

 

new sg.symbols.SimpleMarkerSymbol(style, size, outline, color)

 

 

Description

create a new SimpleMarkerSymbol object (with parameters).

 

Position

Symbol.js

 

 

Parameters

 

Parameter

Type

Description

style

String

symbol style

size

Number

symbol size

outline

sg.symbols.SimpleLineSymbol        

symbol outline

color

sg.Color

symbol color

 

 

Constants

 

Constants

Description

sg.symbols.SimpleMarkerSymbol.STYLE_CIRCLE

circle marker.

sg.symbols.SimpleMarkerSymbol.STYLE_CROSS

cross marker.

sg.symbols.SimpleMarkerSymbol.STYLE_DIAMOND

diamond marker.

sg.symbols.SimpleMarkerSymbol.STYLE_PATH

marker defined by a SVG path string.

sg.symbols.SimpleMarkerSymbol.STYLE_SQUARE

square marker.

sg.symbols.SimpleMarkerSymbol.STYEL_X

diagonal cross.

 

 

 

Properties

 

Property

Type

Description

angle

Number

The angle of the marker.

color

sg.Color

Symbol color

outline

sg.symbols.SimpleLineSymbol

Outline of the marker.

path

String

SVG Path of the icon

size

Number

Size of the marker in pixels.

style

String

The marker style.

type

String

The type of symbol

xoffset

Number

The offset on the x-axis in pixels.

yoffset

Number

The offset on the Y-axis in pixels.

 

 

Methods

 

Methods

Type

Description

setColor(color)

sg.Color

define symbol color.

Name

Type

Description

color

sg.Color

Symbol color.

setAngle(angle)

Number

define the rotation angle.

Name

Type

Description

angle

Number

The angle value.

setSize(size)

Number

define symbol size.

Name

Type

Description

size

Number

The width of the symbol in pixels.

setOffset(x, y)

Number

define symbol offset in x and y direction.

Name

Type

Description

x

Number

The X offset value in pixels.

y

Number

The Y offset value in pixels.

setOutline(outline)

sg.symbols.SimpleLineSymbol

define symbol outline.

Name

Type

Description

outline

sg.symbols.SimpleLineSymbol

Symbol used for outline.

setPath(path)

String

define SVG path.

Name

Type

Description

path

String

SVG path of the icon.

setStyle(style)

String

define symbol style.

Name

Type

Description

style

String

Marker style. See the Constants table for valid values.

toXml(innerText)

innerText:String

Returns:String

 

convert to XML string

Name

Type

innerText

String

Returns:

Type

Description

String

Convert symbol to XML representation.

 

 

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);

 

var defaultMarkerSymbol = new sg.symbols.SimpleMarkerSymbol(sg.symbols.SimpleLineSymbol.STYLE_CIRCLE, 12, outline, new sg.Color(38, 155, 0, 0.6));

 

 

See live demo

 


©2015 Supergeo Technologies Inc.