<< Click to Display Table of Contents >>

 

new sg.symbols.PictureMarkerSymbol(url, width, height)

 

 

Description

create a new PictureMarkerSymbol object

 

Position

Symbol.js

 

 

Parameters

 

Parameter

Type

Description

url

String

URL to the picture

width

Number

picture width

height

Number

picture height

 

 

Properties

 

Properties

Type

Description

angle

Number

The angle of the marker.

color

sg.Color

Symbol color.

size

Number

Size of the image in pixels.

type

String

The type of the symbol.

url

String

URL of the image.

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

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.

setUrl(url)

String

define image URL.

Name

Type

Description

url

String

URL location of marker image.

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 size of the image in pixels.

setWidth(width)        

Number

define symbol width.

Name

Type

Description

width

Number

Width of marker in pixels.

setHeight(height)

Number

define symbol height.

Name

Type

Description

height

Number

Height of marker in pixels.

 

Example

 

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

 

var Boys = new sg.symbols.PictureMarkerSymbol("http://cdn.mysitemyway.com/etc-mysitemyway/icons/legacy-previews/icons-256/glowing-green-neon-icons-people-things/111914-glowing-green-neon-icon-people-things-people-child2.png", 50, 50);

 

Boys.setColor(sg.Color(255, 0, 0, 1));

Boys.setOffset(5, 5);

 

 

 

See live demo

 

 


©2015 Supergeo Technologies Inc.