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

Hi,

 

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("http://gis-server.cc.wmich.edu/harcgis/rest/services/hdream/bothcounties_psrazero/MapServer/0",{         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 = "http://gis-server.cc.wmich.edu/harcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"; var printTask = new esri.tasks.PrintTask(printUrl);         var params = new esri.tasks.PrintParameters();         var template = new esri.tasks.PrintTemplate();              params.map = 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){   window.open(result.url); }) }  

 

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?

 

thanks

Outcomes