Select to view content in your preferred language

How to filter layers in a legend: understanding PrintTemplate.layoutOptions.legendLayers

3727
10
Jump to solution
11-29-2016 02:34 PM
PitersonPaulgek
Deactivated User

Hi,

I try to define the list of layers to be included in a legend in print task. It (marked with red color) has no impact on output printed image. It always only one layer - "address_points" (I tried ["address_points,streets,lakes"] or ["streets,"] or ["lakes"]). I see in debug mode that "map" object contains layerIds ("address_points,streets,lakes").

I tried to use PrintTemplate.layoutOptions.legendLayers

template2.layoutOptions = {
"titleText": title,
"authorText": author,
"copyrightText": "<Copyright info here>",
"legendLayers": ["address_points,streets,lakes"],
"scalebarUnit": "Miles",
};

Please explain how to make it working.

I also noticed the question (see the link below), but cannot understand it.

Javascript API print task legend with dynamically rendered layer 

0 Kudos
10 Replies
PitersonPaulgek
Deactivated User

Robert,

Thank you.

I will do more testing. And publish the result.

0 Kudos