PrintTemplate showAttribution does not seem to work at all.

2636
8
10-14-2015 07:37 AM
DavidChrest
Occasional Contributor II

Love the Print dijit but the PrintTemplate.showAttribution property appears to be useless unless I am really missing something.

No matter if I set it to true or false, Attribution text of esri's topo basemap appears as well as Attribution info for a Web Tiled Layer I add. My initial map object (esri topo) has showAttribution as false. Setting showAttribution to false in my Web Tiled Layer has no effect.

I also noticed that when the PDF is landscape, only the esri topo Attribution appears in the lower-right corner, but when it is portrait orientation, both esri's topo and the Web Tiled Layer I add Attribution info is included. Hmmm.

I'm using our Export Web Map Task on ArcGIS Server 10.3.

Would really love to get rid of that cluttering text if at all possible.

Thanks so much, any help is much appreciated.

David

0 Kudos
8 Replies
RobertScheitlin__GISP
MVP Emeritus

David,

  Strange when I use:

template.showAttribution = false;

it works fine for me.

0 Kudos
DavidChrest
Occasional Contributor II

Robert,

You must be using the Jedi Mind Trick. Seems like such a simple property setting but will not work for me.

Here is my code snippet:

templates = array.map(templateNames, function (ch) {
  var plate = new PrintTemplate();
  plate.layout = plate.label = ch;
  plate.format = "PDF";
  plate.showAttribution = false,
  plate.exportOptions = {
  dpi: 150
  };
  plate.layoutOptions = {
  "legendLayers": [legendLayerD1A, legendLayerD2A],
  "titleText": "Moves Map",
  "scalebarUnit": "Miles"
  };
  return plate;
  });
0 Kudos
RobertScheitlin__GISP
MVP Emeritus

David,

  Hmm. the only thing I see wrong is the comma instead of semicolon in your code.

plate.showAttribution = false;

I am not doing the same thing as you but here is more of my code that works (in case it might help):

        var printTask = new PrintTask('my print task url');
        var template = new PrintTemplate();
        this.imgHeight = (740/oWid) * oHgt;
        template.exportOptions = {
          width: 1542,
          height: (1542/oWid) * oHgt,
          dpi: 200
        };
        template.format = "jpg";
        template.layout = "MAP_ONLY";
        template.preserveScale = false;
        template.showAttribution = false;

        var params = new PrintParameters();
        params.map = this.map;
        params.template = template;
        printTask.execute(params, lang.hitch(this, this.printResult));
0 Kudos
DavidChrest
Occasional Contributor II

OK, yes, silly of me to leave off that semicolon but this fix still did not do anything. You have a params.template thing going but I'm using an array for all the print choices. I'm utilizing code from this example: Print templates with esri.request | ArcGIS API for JavaScript. I'm suspicious this is some kind of bug if used this way. All the other PrintTemplate properties such as format, exportOptions, layoutOptions work great but there is something definitely wrong with the showAttribution property.

0 Kudos
ChrisSmith7
Frequent Contributor

I tried this - it didn't work:

Is it possibly an issue with the version of the print service? I'm using Server 10.3...

RobertScheitlin__GISP
MVP Emeritus

I am not sure if it the version, but I am using 10.3.1

0 Kudos
ChrisSmith7
Frequent Contributor

Found an old thread with similar observations - Printing: Show Attribution

David Marquardt was never successful in getting it to work, but worked around it by creating a custom template. I'm using the default template.

DavidChrest
Occasional Contributor II

Chris,

Yes, I found that post earlier but his trick of moving the service credits out of view will not work for me. My published services are just MXDs with just feature layers, no base maps. The attributes appear because I am bringing in esri's topo and other Web Tiled Layers. Like you found in your code above, showAttribution just does not work.

0 Kudos