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; }); }
Solved! Go to Solution.
Hi Derek,
I managed to modify my application to work with 3.2. Thanks for your help fixing the renderer issue.
Now I am trying to set up the legend but it is not working. The code below shows the legend only when the "Map it" button is clicked twice. I added a global variable (legendDijit), added CSS code as below and added this small piece of code to your existing code.