A graphic can also have an associated InfoTemplate that defines how the attribute data is displayed in a pop-up window. In the following code example, we create a point graphic, symbolize it, and then assign attribute information by using key/value pairs. In this instance we have keys that include address, city, and state. Each of the keys has a value. The variable that contains the attribute data is the third parameter we supply to the constructor for a new point graphic. An InfoTemplate defines the format of the pop-up window that appears and contains a title and an optional content template string:
var pointESRI = new Point(Number(theX), Number(theY),msr); var markerSymbol = new SimpleMarkerSymbol(); markerSymbol.setStyle(SimpleMarkerSymbol.STYLE_SQUARE); markerSymbol.setSize(12); markerSymbol.setColor(new Color([255,0,0])...