Quantcast
Channel: Forums - ArcGIS Viewer for Flex
Viewing all articles
Browse latest Browse all 2097

Legend Layer in print widget

$
0
0
Hi,
I want to add only a few layers in the legend to the print parameters.layoutOptions.legendLayers
The API documentation mentions that one can use the layerlegends class to supply the desired layers.
However how do I use this class i have tried the follwing but it odesnt seem to work.


var arry:Array =new Array();
for(var i:int=0;i<mapPrint.layerIds.length;i++)
{
var layer:Layer = mapPrint.getLayer(mapPrint.layerIds[i]);
if(layer is ArcGISDynamicMapServiceLayer){
var arcGisdynamiclayer:ArcGISDynamicMapServiceLayer = layer as ArcGISDynamicMapServiceLayer;

var legendLayer:LegendLayer = new LegendLayer;
legendLayer = arcGisdynamiclayer;
arry.push(legendLayer);
}
}
legendOpts.legendLayers = arry;
regards,
Nigel

Viewing all articles
Browse latest Browse all 2097

Trending Articles