Graphic can contain geometry, a symbol, attributes, or an
infoTemplate. A Graphic is displayed in the GraphicsLayer. The GraphicsLayer allows you to
listen for events on Graphics.
Graphic
require(["esri/Graphic"], function(Graphic) { /* code goes here */ });
Constructors
Name |
Summary |
new Graphic(geometry?, symbol?, attributes?, infoTemplate?) |
Creates a new Graphic object. |
new Graphic(json) |
Creates a new Graphic object using a JSON object. |
Properties
Name |
Type |
Summary |
attributes |
Object |
Name value pairs of fields and field values associated with the
graphic. |
geometry |
Geometry |
The geometry that defines the graphic. |
infoTemplate |
InfoTemplate |
The content for display in an InfoWindow. |
symbol |
Symbol |
The symbol for the graphic. |
visible |
Boolean |
Indicate the visibility of the graphic. |
Methods
Name |
Return type |
Summary |
attr(name, value) |
Graphic |
Adds a new attribute or changes the value of an existing attribute on the
graphic's node. |
draw() |
Graphic |
Draws the graphic. |
getContent() |
String |
Returns the content string based on attributes and infoTemplate values. |