On the Print Webmap sample (Print webmap | ArcGIS API for JavaScript ) there is this code and comment...
legendLayers: [], // empty array means no legend
What is supposed to be passed into here? The legend dijit has layers and layerInfos. I have tried both but I am not seeing any legend or symbology on the output.
Hi James,
I think you need to pass it a LegendLayer (notice no "s" on the end) object.
This is probably the best discussion of how it works that I've been able to find.
No legend showing at all in ArcGIS Server print task (MapExport) - Geographic Information Systems Stack Exchange
Also, note that if you delete that line you'll get a legend in your printed map.
Jarrod
According to this page, you want to use the layerId for the layers you want to add: PrintTemplate | API Reference | ArcGIS API for JavaScript
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.