Edit this page

Legend

The RadMap control introduces the MapLegendElement object. It allows displaying a legend for a particular layer inside the control.

Figure 1: Map Legend

map features legend 001

Setup Legends

Legend items can be added by accessing the Children collection of the legend stack element. The code fragment below extends the Layers Overview example by adding two legends.

Figure 2: Setup Legends

map features legend 002

Customizing Appearance

this.radMap1.MapElement.LegendElement.TitleElement.Text = "NBA";
this.radMap1.MapElement.LegendElement.SubtitleElement.Text = "Conferences";
this.radMap1.MapElement.LegendElement.Orientation = Orientation.Horizontal;
this.radMap1.MapElement.LegendElement.ItemStackElement.Children.Add(new MapLegendItemElement("Western", Color.Red));
this.radMap1.MapElement.LegendElement.ItemStackElement.Children.Add(new MapLegendItemElement("Eastern", Color.Blue));

Me.RadMap1.MapElement.LegendElement.TitleElement.Text = "NBA"
Me.RadMap1.MapElement.LegendElement.SubtitleElement.Text = "Conferences"
Me.RadMap1.MapElement.LegendElement.Orientation = Orientation.Horizontal
Me.RadMap1.MapElement.LegendElement.ItemStackElement.Children.Add(New MapLegendItemElement("Western", Color.Red))
Me.RadMap1.MapElement.LegendElement.ItemStackElement.Children.Add(New MapLegendItemElement("Eastern", Color.Blue))

See Also