Esri Js v 4.13 - Legend and Print Widgets

586
4
12-10-2019 12:35 AM
IanMagero
New Contributor III

Hi,

a) For the Print widget how can I set the legend to be used as it is using a legend of the first layer but I want it use the legend of the 3rd layer as I have three layers?

Best Regards.

0 Kudos
4 Replies
KellyHutchins
Esri Frequent Contributor

I'm not 100% sure I understand the question but it sounds like you only want the legend for the third layer to show up in the print output? If so one option would be to set the layerInfos of the legend to only be the layer you want to display before printing. 

Legend | ArcGIS API for JavaScript 4.13 

0 Kudos
IanMagero
New Contributor III

Yes you have understood the question.

I already added the layerinfos but still the legend on the printout is from two layers

0 Kudos
KellyHutchins
Esri Frequent Contributor

Ok. Can you try specifying a print template and the legendLayers. 

PrintTemplate | ArcGIS API for JavaScript 4.13 

IanMagero
New Contributor III

Thanks for the quick response.Let me try it out and see.

0 Kudos