AnsweredAssumed Answered

Legends for Tiled map services don't display in Print output?

Question asked by steinj14 on Jun 18, 2013
Latest reply on Sep 25, 2014 by koder303
I have downloaded the Basic Viewer template. I am creating my webmap with code (partial listing below).

        webmap.itemData = {           "operationalLayers": [              //Developable Land (display tiled service)            { "url": "",              "visibility": false,              "opacity": 1,              //"visibleLayers": [],              //"minScale": 100000,              //"maxScale": 0,              "title": "Developable Land",              "id": "devland",              "description": null            },            //Community-Based Planning Area (display dynamic map service)                                 { "url": "",              "visibility": false,              "opacity": 0.6,              //"visibleLayers": [],              //"minScale": 100000,              //"maxScale": 0,              "title": "Community-Based Planning Areas",              "id": "cpa",              "description": null            }, 

I have added several operational layers (dynamic and tiled map services hosted on my server). All are being displayed in the map and legend as expected.

The problem is that when I print, the legend for the tiled map services are not being displayed on the print output.  I have tested with a single tiled layer with only 1 legend entry, so I know it's not a matter of the legend getting cut off.  The tiled service is displayed on the map of the printed output as expected.

Here's the addPrint function from the Basic Viewer. I commented out the 'legendLayers' setting so the legend will display.

function addPrint() {     var layoutOptions = {         'authorText': configOptions.owner,         'titleText': configOptions.title,         'scalebarUnit': (i18n.viewer.main.scaleBarUnits === 'english') ? 'Miles' : 'Kilometers',         //'legendLayers': [] //comment out so the legend will display by default, 6/13/13 jms.     };      //TODO - replace default templates with info from service     var templates =, function (layout) {         layout.layoutOptions = layoutOptions;         return layout;     });     // print dijit     var printer = new esri.dijit.Print({         map: map,         templates: templates,         url: configOptions.helperServices.printTask.url     }, dojo.create('span'));      dojo.query('.esriPrint').addClass('esriPrint');      dojo.byId('webmap-toolbar-center').appendChild(printer.printDomNode);      printer.startup();   }

Any idea why legends for tiled map services do not print?  I am using the ESRI print service, though I wouldn't think that would make a difference.