AnsweredAssumed Answered

FeatureLayer and GraphicsLayer  not printing

Question asked by dahsande on Jan 9, 2013
Latest reply on Jan 10, 2013 by dahsande
I have a multi-layered map that I need to print. After adding my base layer, I add a FeatureLayer that displays a set of regions or districts that are color-coded using a ClassBreaksRenderer. (The FeatureLayer gets its geometric data from a standard ArcGIS service and its classification data from a SQL query.)  Then I add a set of labels (Graphics using a TextSymbol) to a GraphicsLayer. All of the shapes and text will show on my map but refuse to print using the esri.dijit.Print object. If, however, I use a SimpleRenderer in place of a ClassBreaksRenderer, the FeatureLayer will print.

Is this by design or is there something I am doing wrong?

I've created a jsFiddle here that will demonstrate the issue I'm having.

Some of my key definitions follow:

Feature layer:
// Create the feature layer var districtShadeLayerDefinition = {  "geometryType": "esriGeometryPolygon",  "objectIdField": "ObjectID",  "fields": [{   "name": "ObjectID",   "alias": "ObjectID",   "type": "esriFieldTypeOID"  },{   "name": "NAME",   "alias": "Name",   "type": "esriFieldTypeString"  },{   "name": "AreaValue",   "alias": "Area Value",   "type": "esriFieldTypeDouble"  }] } ; app.districtShadeValuesSet = []; var districtShadeCollection = {  "layerDefinition": districtShadeLayerDefinition,  "featureSet": {   "features": app.districtShadeValuesSet,   "geometryType": "esriGeometryPolygon"  } }; app.districtShadeLayer = new esri.layers.FeatureLayer(districtShadeCollection, {id: 'valueLayer', infoTemplate: app.infoTemplate, mode:esri.layers.FeatureLayer.MODE_SNAPSHOT, outFields:"*"});;

Class breaks renderer:
// create default symbols and colors var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID  , new dojo.Color([255, 255, 255, 0.35]), 1), new dojo.Color([125, 125, 125, 1])); var renderer = new esri.renderer.ClassBreaksRenderer(symbol, "AreaValue"); var selectedClasses = 3; var colorList = ["#F00","#0F0","#00F"];  // create the renderer for (var i = 0; i < selectedClasses; i++) {  var lowerBound = app.classBreaks[i];  var breakValue = app.classBreaks[i + 1];  var adjustedBreakValue;  if (i < selectedClasses - 1) {   // calculate the upper bound for this break, since class breaks are >= min and < max   adjustedBreakValue = app.classBreaks[i + 1];  }  else {   adjustedBreakValue = Infinity;  }  renderer.addBreak(lowerBound, adjustedBreakValue, new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color(colorList[i]))); } app.districtShadeLayer.setRenderer(renderer);

Any assistance you can provide would be very much appreciated.