Select to view content in your preferred language

LegendLayer.layerId setup for Parcel Viewer web application template

2333
0
01-02-2014 01:51 PM
Labels (1)
LeeBrannon
Regular Contributor
Has anyone out there successfully customized the legend in the print widget of the Parcel Viewer web map template so that the print legend displays some of the map viewer layers but not all of them?

My ArcGIS Resources research thus far indicates that a layer "id" must be setup for each operational layer on the map, in this fashion: "id": "PoolPermits", to be able to use the LegendLayer class to choose specific layers for the legend. But with the web application template pulling in dynamic map services in its unconventional way from the ArcGIS Online map viewer, I have not been able to figure out how to setup the required id.

Below is sample code (not mine) of what I am trying to get implemented.

var legendLayer = new esri.tasks.LegendLayer();
legendLayer.layerId = "PoolPermits";
legendLayer.subLayerIds = [0, 1];

printParams.template.layoutOptions = {
titleText: pThis.titleEntryTextBox.value,
authorText: pThis.authorEntryTextBox.value,
copyrightText: pThis.copyrightText,
scalebarUnit: pThis.scalebarUnit,
legendLayers: pThis.legendLayer
};


Lee
0 Kudos
0 Replies