The four parts of a Graphic
A graphic is composed of four items: Geometry, Symbol, Attributes, and an InfoTemplate, illustrated in the screenshot as follows:
A graphic has a geometric representation that describes its shape, and where it is located. However, a graphic can also have attributes which are name-value pairs that describe the graphic as well as an InfoTemplate
that defines the format of the InfoWindow
that appears when a graphic is clicked. After creation, graphic objects must be stored inside a GraphicsLayer
object before they can be displayed on the map. This GraphicsLayer
object functions as a container for all graphics that will be displayed.
All elements of a graphic are optional. However, the geometry and symbology of a graphic are almost always assigned. Without these two items there would be nothing to display on the map, and there isn't much point in having a graphic unless you're going to display it.
In the following you will see a code example showing the typical process...