AnsweredAssumed Answered

renderer for graphicslayer not working?

Question asked by thebasicimage on Feb 7, 2014
Latest reply on Feb 7, 2014 by thebasicimage
I am trying to add a renderer to a graphicslayer.  My graphics layer shows up fine and i can control the symbology manually (If i change the symbol color, it changes,etc.) 

However, if i create a renderer and add it to the layer, the "default" symbology is still retained.

Please help.

Thank you.


//CODE
symbol1 = new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color([255, 0, 0,0.5]))
gl = new esri.layers.GraphicsLayer();
                                  
var attr = {"MY_VALUE":5}
gl.add(
         new esri.Graphic(
         new esri.geometry.Point(-75.03810508573053, 40.26871269474917),
         symbolX,
         attr
   )
)

map.addLayer(gl);

renderer1 = new esri.renderer.ClassBreaksRenderer(symbol1, "MY_VALUE");
renderer1.addBreak(0,3,new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color([255, 0, 0,0.5])));
renderer1.addBreak(4,7,new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color([0, 255, 0,0.5])));
renderer1.addBreak(8,Infinity,new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color([0,0,255,0.5])));

gl.setRenderer(renderer1)

Outcomes