Select to view content in your preferred language

GraphicsLayer.setRenderer(Renderer<Graphic>) vs Graphic(Geometry, Symbol)

1402
0
02-01-2012 10:32 PM
_lkerArg_n
Emerging Contributor
Lets say I want to add a graphic on a graphics layer on the map. I do this by the code below

   
    GraphicsLayer gl = new GraphicsLayer();
    Geometry geometry = new Point(xPoint, yPoint);
    Graphic graphic = new Graphic(geometry, new SimpleMarkerSymbol(Color.BLUE, 15, STYLE.CIRCLE));
    gl.addGraphic(graphic);
    


I have to give a symbol(for defining how to render the graphic) as an attribute to the graphic constructor. So, why is there a setRenderer function for graphics layer?
0 Kudos
0 Replies