[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Collapse]Map Control
   [Expand]Getting Started
    Layers
   [Expand]Coordinate Systems
   [Expand]Map Image Data
   [Expand]GIS Data
   [Expand]Vector Data
   [Collapse]Visual Elements
     Map Area
     Mini Map
    [Expand]Navigation Elements
     Search Panel
     Vector Items
     Legends
   [Expand]End-User Interaction
   [Expand]Examples
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Legends

A Legend is a panel that shows information about value meanings of vector items. This may be information about either item colors or item sizes, depending on the item's nature.

To add a legend to the Map control, it is necessary to create an appropriate MapLegendBase class descendant (either a color-based or size-based legend) and add it to the MapControl.Legends collection.

Then, it is required to specify a layer which contains vector items to be annotated by this legend. To do this, assign this layer object to the ItemsLayerLegend.Layer property.

Below you will find the more detailed information about various types of legends supported by the Map control.

Expanded Color-Based Legend

A Color-Based Legend is intended to detail the meaning of specific colors. In this case, a layer specified by a legend's ItemsLayerLegend.Layer property should contain vector items colorized by one of the following colorizers:

There are two types of color-based legends.

The main properties that affect element appearance and functionality are listed below.

Group

Properties

Availability MapControl.Legends
Layout HorizontalAlignment, VerticalAlignment
Elements ItemsLayerLegend.Layer, ColorLegend.CustomItems
Appearance MapLegendBase.Header, MapLegendBase.Description, ColorLegend.ItemTemplate, MapLegendBase.ItemLabelTemplate, Background, Foreground, BorderBrush

For more information on using these legends, see the following examples:

Expanded Size-Based Legend

A Size-Based Legend details the meaning of various sizes in MapBubble or MapPie charts.

This legend type is represented by the SizeLegend class. The appearance of the size-based legend is defined by its SizeLegend.Type property value.

SizeLegend.Type = Inline

SizeLegend.Type = Nested

The main properties that affect element appearance and functionality are listed below.

Group

Properties

Availability MapControl.Legends
Layout HorizontalAlignment, VerticalAlignment
Elements ItemsLayerLegend.Layer, SizeLegend.CustomItems
Appearance MapLegendBase.Header, MapLegendBase.Description, MapLegendBase.ItemLabelTemplate, Background, BorderBrush, Foreground, SizeLegend.Type, SizeLegend.ShowTickMarks

To learn how to create a SizeLegend object, refer to Lesson 3 - Add Analytical Data to a Geographical Map.

Is this topic helpful?​​​​​​​