Select to view content in your preferred language

Bug in legend widget? Grouped legend values appear multiple times

4466
21
12-09-2010 01:45 PM
StephenLead
Regular Contributor III
In ArcMap, create a Unique Values symbology, select multiple categories, then right-click and Group them.

Publish to ArcGIS Server and add as a dynamic map service. Using the new JS API version 2.1 legend widget, create a legend from this layer.

I'm finding that the grouped categories display multiple times. Eg, if the group consists of 3 individual categories, the (identical) symbol will appear in the legend 3 times.

Please let me know if you need any further information to reproduce this bug.

Thanks,
Steve

PS I have no idea why this title has a smiley face. Maybe that's another bug.
0 Kudos
21 Replies
KellyHutchins
Esri Frequent Contributor
I tested with both msd and mxd and can't reproduce but I'll keep researching this.
0 Kudos
StephenLead
Regular Contributor III
Thanks Kelly.

As a workaround, I created a new field and calculated the value that I wanted to appear in the legend, and used this to set the symbology.
0 Kudos
StephenLead
Regular Contributor III
Hi Kelly,

Try making a legend from the feature service at:

http://203.14.35.213/ArcGis1/rest/services/atlas/NaturalEnvironment_NationalParks/MapServer/0

I'm finding that the Other category appears 4 times, as there are 4 classes which I've combined into a single class.

Thanks,
Steve
0 Kudos
RichardKaufholz
New Contributor
Hi Guys,

I am coming across the same problem. In fact, it is not a bug with the legend widget, it has to do with how the rest service is defined from your layer symbology setup in ArcMap. I am building my own custom TOC and this had me stumped for a while. It happens in two instances that I am aware of:

- using "Unique values" in ArcMap, selecting a few categories and grouping them manually
- using "Unique values, many fields" in ArcMap (example in the attached esri_001.jpg)

When you check the rest service information, you will see some 17 entries under "Unique Value Infos: ". Which is essentially re-splitting your groups and undoing all your hard work! (abbreviated screenshot at esri_002.jpg)

So, you can workaround by creating a new column, and manually creating unique categories, but since our data is held in someone else's database, this is not an option for us.

Is there some other approach to this? And/or will ESRI be looking at why this happens in Rest and if it can be fixed?

Thanks,
Richard.
0 Kudos
JeffPace
MVP Alum
Any update on this? we have the same problem.  If there are 4 values (even groups) in the mxd, there should only be 4 values in the legend. 




Hi Guys,

I am coming across the same problem. In fact, it is not a bug with the legend widget, it has to do with how the rest service is defined from your layer symbology setup in ArcMap. I am building my own custom TOC and this had me stumped for a while. It happens in two instances that I am aware of:

- using "Unique values" in ArcMap, selecting a few categories and grouping them manually
- using "Unique values, many fields" in ArcMap (example in the attached esri_001.jpg)

When you check the rest service information, you will see some 17 entries under "Unique Value Infos: ". Which is essentially re-splitting your groups and undoing all your hard work! (abbreviated screenshot at esri_002.jpg)

So, you can workaround by creating a new column, and manually creating unique categories, but since our data is held in someone else's database, this is not an option for us.

Is there some other approach to this? And/or will ESRI be looking at why this happens in Rest and if it can be fixed?

Thanks,
Richard.
0 Kudos
StephenLead
Regular Contributor III
it is not a bug with the legend widget, it has to do with how the rest service is defined from your layer symbology setup in ArcMap


Richard, I think you're right. Perhaps we should be reporting this to the core ArcGIS Server or REST team, since it's nothing to do with the JS API.

I'm not on maintenance so I can't log a bug report - can someone else do it?

Cheers,
Steve
0 Kudos
JeffPace
MVP Alum
Richard, I think you're right. Perhaps we should be reporting this to the core ArcGIS Server or REST team, since it's nothing to do with the JS API.

I'm not on maintenance so I can't log a bug report - can someone else do it?

Cheers,
Steve


Done 🙂 In May 😞

#NIM067830  When using symbology of unique values, getting a duplicate entry in the legend service of the REST endpoint
0 Kudos
JeffPace
MVP Alum
Done 🙂 In May 😞

#NIM067830  When using symbology of unique values, getting a duplicate entry in the legend service of the REST endpoint


Just checked.  This bug was submitted may 5th, 2011.  Medium Severity.  Not fixed.
0 Kudos
BrianMcLeer1
New Contributor
I have recently began using the TOC widget for a Java App, Does anyone know how to make it so all layers are off and all groups are collapsed by default? Thank you.
0 Kudos
KenBuja
MVP Esteemed Contributor
If you're talking about NLiu's TOC widget, you'll find the documentation here. By setting the visible layers for all the layers to -1, all groups will be collapsed.
0 Kudos