AnsweredAssumed Answered

Renderer and Printtask: Layer grayed out in image

Question asked by mborr on Sep 4, 2014
Latest reply on Sep 5, 2014 by mborr



Having trouble with printtask and the export web map tool in Javascript API (legacy)


A user selects values from drop downs, then, a function calls a feature service with a unique values based on the field selected.


      ct = new esri.layers.FeatureLayer("",{         mode: esri.layers.FeatureLayer.MODE_ONDEMAND,         opacity: .7,         outFields: ["*"],   //and  
     var renderer = new esri.renderer.SimpleRenderer(new esri.symbol.SimpleFillSymbol().setOutline(new esri.symbol.SimpleLineSymbol().setWidth(0.5)));      renderer.setColorInfo({         field: field,           minDataValue: 0,          maxDataValue: maxval,             colors: [               new esri.Color([255, 255, 255]),               new esri.Color([0, 42, 255])             ]           });                                  ct.setRenderer(renderer);             map.addLayer(ct);           map.reorderLayer(ct,4); 


Variable maxval is decided by user.


Then the print task:

function print() {      var printUrl = ""; var printTask = new esri.tasks.PrintTask(printUrl);         var params = new esri.tasks.PrintParameters();         var template = new esri.tasks.PrintTemplate();     = map;         template.exportOptions = {             width: 1000,             height: 800,             dpi: 96         };                 template.layout = "MAP_ONLY";         template.preserveScale = false;         template.format = "jpg";         template.showAttribution= "true";           params.template = template;         printTask.execute(params);         dojo.connect(printTask,'onComplete',function(result){; }) }  


Printing works just fine for other layers, but when the layer ct is added, it appears as a gray box instead of multi -colored choropleth layer.


Is it because the renderer is client-side? How might I get around that so the user can have the choropleth map in the printout?