Can anyone please show how to get a legend layers from multiple services into the print template? It appears I can only pick one set of items, but which service do those items come from?
Thanks.
Hi there!
I don't know if you still search an Answer for this Problem, but here's what i hav done to insert two Legends from differnet Layers.
It's pretty simple
app.LegendForTemplate = new LegendLayer();
app.LegendForTemplate.layerId = "yourLayerIDhere";
app.LegendForTemplate.subLayerIds = [0,2];
and for the second Layer
app.LegendForTemplate2 = new LegendLayer();
app.LegendForTemplate2.layerId = "YourLayerID";
app.LegendForTemplate2.subLayerIds = [1,2,3];
In your Printtemplate you have to declare this two together like:
var template = new PrintTemplate();
template.layoutOptions = {
//legendLayers: [], // empty array means no legend
legendLayers: [app.LegendForTemplate,app.LegendForTemplate2],
...
Regards, Miriam
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.