Select to view content in your preferred language

Print Template Layout Options Legend Layers

2611
1
11-17-2014 01:41 PM
BrentHoskisson
Frequent Contributor

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.

0 Kudos
1 Reply
MiriamBrockmann
Frequent Contributor

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