AnsweredAssumed Answered

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

Question asked by piterpaulppp on Nov 29, 2016
Latest reply on Dec 4, 2016 by piterpaulppp


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