Select to view content in your preferred language

Exclude sublayer from Legend

1810
5
06-29-2012 11:11 AM
ZahidChaudhry
Occasional Contributor III
Is it possible to exclude sublayer from legend? Flex Viewer (3.0)
Tags (2)
0 Kudos
5 Replies
DasaPaddock
Esri Regular Contributor
0 Kudos
ZahidChaudhry
Occasional Contributor III
Yes, you can use the excludelayer tag.

See:
http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Legend_widget_tags/01m30000001r...


I have three sublayers and I just want to exclude one of the sublayer..so this is not going to help me as I do want those other two layers in the legend
0 Kudos
DasaPaddock
Esri Regular Contributor
OK, that's not supported. It's entered as a possible future enhancement.
0 Kudos
ArtoVuorela
New Contributor
How about in Viewer 3.2? Something like this in config.xml:
<layer label="Map" type="dynamic" visible="true" alpha="1"
                url="http://.../arcgis/rest/services/my_vector/MapServer" >      
                <sublayer id="1" label="Asemat"/>
</layer>
And in LegendWidget.xml:
<excludelayer>Asemat</excludelayer>
Does not seem to work...
0 Kudos
DougBrowning
MVP Esteemed Contributor
I did this by adding and if statement to the CreateChildren function in TOCMapLayerItem.as.

I kept a global var of layers and sublayers I wanted and checked against that in the if statement.  I did this because my TOC was dynamic.  For your case you could just read from a xml and check against it.

Put the if statement around  layerInfos.push(layerInfo);

Hope that helps.



http://forums.arcgis.com/threads/76052-A-way-to-access-a-layer-inside-a-map-service-without-accessin...
0 Kudos