AnsweredAssumed Answered

PrintTask - Custom Legend

Question asked by amurdoch22 on Sep 15, 2020
Latest reply on Sep 17, 2020 by amurdoch22

Good Day

 

Is there a way to build in a custom legend with the Print Task output?  Assuming I have the following output

Can I have only one set of data per geometry shown in the legend, without restructuring how our data is broken down by feature layer?  Ideally I'd want to change the legend based on the condition at the time the printMap function is executed.


My Print Code:

printMap() {
  const printTask = this.PrintTask({
    url: 'https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task'
  });

  const template = new this.PrintTemplate({
    format: 'jpg',
    layout: 'a4-landscape',
    layoutOptions: {
      titleText: '',
      authorText: 'Infrasol'
    }
  });

  const params = new this.PrintParameters({
    view: this._view,
    template: template
  });

  this.printProgress = true;
  printTask.execute(params).then( (result) => {
    this.printProgress = false;
    window.open(result.url);
  }, (err) => {
    this.printProgress = false;
    console.log('ESRI Print Task Error: ', err);
  });
}


Thanks

Outcomes