Select to view content in your preferred language

Silverlight - Customizing Legend Control

2641
3
06-28-2011 08:00 AM
JustinSouders1
New Contributor
We are trying to accomplish the following in the legend control

1.  Custom Defined Groupings
[INDENT]

  • We would like to group similar layers into categories.  For example, if we have an appraisal points layer and an appraisal polygons layer we would like to have them grouped under an appraisal category, that would turn all layers in this category off/on (see attached graphic).

[/INDENT]

2.  Custom Graphics
[INDENT]

  • We would like to provide custom graphics/icons.  Some of our layers in our legend (example: polygons) do not show their associated graphic/icon.  We would like to provide our own that would show up in the legend (see attached graphic).

[/INDENT]

I've attached a word document that has our current code for our layers, a screenshot of our current legend, and a mock up of the legend we are trying to create.
0 Kudos
3 Replies
João_VictorCoelho
Emerging Contributor
Hi Justin,

You should download the source code of the API in : http://esrisilverlight.codeplex.com/ and customize the Legend Control.
0 Kudos
DavidHollema
Deactivated User
I had a similar challenge with defining custom groups in the legend control.  Question.  Can you do the grouping in the mxd driving the map service or does the grouping need to be done client-side in your silverlight app?  Server side in my opinion is easier if you have that option.  For lengthy discussion on doing it client side, see..

http://forums.arcgis.com/threads/26023-Extending-Legend-Control
0 Kudos
DominiqueBroux
Esri Frequent Contributor
It's also worthg noting that the next SL API version (2.3) will allow to create group layers and so to get exactly what you are expecting in your attached word document.
0 Kudos