Adding point graphics

Points can be added to the graphics layer and displayed either using one of the SimpleMarkerSymbols (Circle, Cross, Diamond, Square, Triangle or X) or a PictureMarkerSymbol displaying an image from a file (such as a .png file) or a URL.

The geographic location of the point is represented by a Point object which contains the x, y and optionally the z (height) and m coordinates of the point. The Symbol and Point are then used together to create a Graphic instance which is then added to the graphics layer, as in the code snippet below:

//create a point marker symbol (red, size 10, of type circle)
SimpleMarkerSymbol simpleMarker = new SimpleMarkerSymbol(Color.RED, 10, Style.CIRCLE);

//create a point a x=-302557, y=7570663 (for a map using metres as units)
Point pointGeometry = new Point(-302557, 7570663);

//create a graphic with the geometry and marker symbol
Graphic pointGraphic = new Graphic(pointGeometry, simpleMarker);

//add the graphic to the graphics layer