New to Telerik UI for WinFormsStart a free 30-day trial

Legend

Updated over 6 months ago

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

Figure 1: Map Legend

WinForms RadMap Legend

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

WinForms RadMap Setup Legends

Customizing Appearance

C#
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));

See Also

In this article
Setup LegendsSee Also
Not finding the help you need?
Contact Support