AnsweredAssumed Answered

Generate Renderer issue

Question asked by samirgambhir on Nov 14, 2012
Latest reply on Dec 7, 2012 by DSwingley-esristaff
Hi,
I am trying to generate a class breaks renderer using generateRenderer task, but the renderer object is not being returned. I am using ArcGIS Server 10.1 with Javascript API v=2.8. I am using the following esri example (Generate Renderer) to build my code.
function renderIndicator(ind, num, url) {  var classDef = new esri.tasks.ClassBreaksDefinition();  classDef.breakCount = num; //number of breaks  classDef.classificationField = ind; //field name  classDef.classificationMethod = "natural-breaks";  classDef.baseSymbol = symbol;          var colorRamp = new esri.tasks.AlgorithmicColorRamp();  colorRamp.fromColor = new dojo.colorFromHex('#ffff80');  colorRamp.toColor = new dojo.colorFromHex('#6B0000');  colorRamp.algorithm = "cie-lab";  // options are:  "cie-lab", "hsv", "lab-lch"  classDef.colorRamp = colorRamp;          var params = new esri.tasks.GenerateRendererParameters();  params.classificationDefinition = classDef;  var generateRenderer = new esri.tasks.GenerateRendererTask(url); //url of a feature layer  generateRenderer.execute(params);  dojo.connect(generateRenderer, function(renderer) {   return renderer;  }); }

The returned 'renderer' object is needed in another function to display features and generate a legend. It seems that dojo.connect is not working. What am I missing here?

Thanks
Samir

Outcomes