<< Click to Display Table of Contents >>

 

new sg.Graphic(geometry, symbol, attributes, infoTemplate)

 

 

Description

Add a new graphic object.

 

Position

Graphic.js

 

Parameters

 

Parameter

Type

Description

geometry

Object

geometry data

symbol

sg.geometry.Geometry        

symbology

attributes

sg.InfoTemplate

attribute data

infoTemplate

sg.symbols.Symbol

infoTemplate

 

 

Properties

 

Properties

Type

Description

attributes

Object

Field values associated with the graphic.

geometry

sg.geometry.Geometry

The geometry that defines the graphic.

layer

sg.layers.GraphicsLayer

The layer that contains the graphic.

symbol

sg.symbols.Symbol

Graphic symbology.

 

 

Methods

 

Methods

Type

Description

getInfoTemplate()

Returns:

sg.InfoTemplate

Return the info template associated with the graphic.

Returns:

Type

Description

sg.InfoTemplate

The info template

setInfoTemplate(p)

sg.InfoTemplate

Define the info template associated with the graphic.

Name

Type

Description

p

sg.InfoTemplate

The info template

setSymbol(symbol)

sg.symbols.Symbol

Define the graphic symbol.

Name

Type

Description

symbol

sg.symbols.Symbol

The symbol

setGeometry(geometry)

sg.geometry

Define the graphic geometry.

Name

Type

Description

geometry

sg.geometry

The geometry of the graphic

draw()


Draw the graphic on the map.

getLayer()


Return the graphic layer containing the graphic.

hide()


Hide the graphic.

show()


Show the graphic.

 

Events

 

Event

Description

click


dbl-click


drag-start


drag


drag-end


mouse-down


mouse-move


mouse-out


mouse-over


mouse-up


 


©2015 Supergeo Technologies Inc.