Sort Legend to Match MXD

403
0
11-28-2011 10:38 AM
DarrenMackiewicz
Occasional Contributor
I have an MXD with a Layer that is symbolized into unique values based on a type attribute.

Let's say the types are

Apple
Banana
Pear
Strawberry

I have them symbolized in that order in my MXD (alphabetical)

Using the Legend Sample Code from online, when I create the legend and the function
- (void) addLegendForLayer:(AGSLayer *)layer
is called.. the legend swatches and names show up in random order

like

Strawberry
Pear
Apple
Banana

The legend items are in order if I view them through REST, but in the legend, as noted above, they are not.

Can the legend swatches be ordered to match the MXD easily?
0 Kudos
0 Replies