<< Click to Display Table of Contents >>

 

new sg.renderers.UniqueValueRenderer(defaultSymbol, attributeField, attributeField2, attributeField3, fieldDelimeter)

 

 

Description

Create a UniqueValueRenderer object.

 

Position

Randerer.js

 

 

Parameters

 

Parameter

Type

Description

attributeField

String

An attribute field renderer which matches certain values.

attributeField2

String

An attribute field renderer which matches certain values.

attributeField3

String

An attribute field renderer which matches certain values.

defaultSymbol

sg.symbols.Symbol

Default symbol.

 

Properties

 

Property

Type

Description

attributeField

String

An attribute field renderer which matches certain values.

attributeField2

String

An attribute field renderer which matches certain values.

attributeField3

String

An attribute field renderer which matches certain values.

colorInfo

Object

symbol color

Name

Type

Description

minValue

Number

minimum value

maxValue

Number

maximum value

field

String

attribute field

colors

Array.<sg.Color>

color array

defaultSymbol

sg.symbols.Symbol

Default symbol.

infos

Array.<Object>

Array of unique values

opacityInfo

Object

symbol transparency

Name

Type

Description

minValue

Number

minimum value

maxValue

Number

maximum value

field

String

attribute field

opacityValues

Array.<Number>

transparency array

rotationInfo

Object

symbol rotation settings:

Name

Type

Description

type

String

geographic(rotates clockwise from North) or arithmetic (rotates counter-clockwise from East)

field

String

attribute field

sizeInfo

Object

symbol size settings:

Name

Type

Description

minSize

Number

minimum size

maxSize

Number

maximum size

field

String

field name

 

 

Methods

 

Methods

Type

Description

addValue(value)

Object

Add a unique value and a matching symbol.

Name

Type

Description

value

Number

Value to match with.

symbol

sg.symbols.Symbol

Symbol used for value.

getOpacity(graphic)

graphic:sg.Graphic

Returns:Number

Return graphic transparency.

Name

Type

Description

graphic

sg.Graphic

Graphic

Returns:

Type

Description

Number

the opacity value for the specified graphic.

getColor(graphic)

graphic:sg.Graphic

Returns:sg.Color

Return graphic color.

Name

Type

Description

graphic

sg.Graphic

Graphic

Returns:

Type

Description

sg.Color

the color for the Graphic

getRotationAngle(graphic)

graphic:sg.Graphic

Returns:Number

Return graphic rotation angle in degrees.

Name

Type

Description

graphic

sg.Graphic

Graphic

Returns:

Type

Description

Number

the angle of rotation for the graphic

getSize(graphic)

graphic:sg.Graphic

Returns:Number

Return graphic symbol size in pixels.

Name

Type

Description

graphic

sg.Graphic

Graphic

Returns:

Type

Description

Number

Size of the graphic

removeValue(value)

None

Remove a unique value.

Name

Type

Description

value

Object

Value to remove.

setColorInfo(info)

Object

Define the color Info.

Name

Type

Description

info

Object

An info object that defines the color

setRotationInfo(info)

Object

Define rotation angle for the renderer.

Name

Type

Description

info

Object

An info object that defines the color

setOpacityInfo(info)

Object

Define symbol transparency

Name

Type

Description

info

Object

An info object that defines the opacity

setSizeInfo(info)

Object

Define symbol size

Name

Type

Description

info

Object

An info object that defines the size

toXml()

Returns:

String

convert XML string

Returns:

Type

Description

String

Convert to XML representation

 

 

Example

 

 

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

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

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

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

 

//Create UniqueValueRenderer

var uniqueValueRenderer = new sg.renderers.UniqueValueRenderer(defaultFillSymbol, "continent");

uniqueValueRenderer.addValue({

    value: "Asia",

    symbol: new sg.symbols.SimpleFillSymbol(sg.symbols.SimpleFillSymbol.STYLE_SOLID, outline, new sg.Color(0, 128, 128, 0.5));

});

uniqueValueRenderer.addValue({

    value: "Africa",

    symbol: new sg.symbols.SimpleFillSymbol(sg.symbols.SimpleFillSymbol.STYLE_SOLID, outline, new sg.Color(128, 128, 0, 0.5));

});

uniqueValueRenderer.addValue({

    value: "North America",

    symbol: new sg.symbols.SimpleFillSymbol(sg.symbols.SimpleFillSymbol.STYLE_SOLID, outline, new sg.Color(0, 255, 255, 0.5);

});

 

 

 

See live demo

 

 


©2015 Supergeo Technologies Inc.