[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
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Collapse]Map Control
   [Expand]Getting Started
   [Expand]Coordinate Systems
   [Expand]Map Image Data
   [Expand]GIS Data
   [Collapse]Vector Data
    [Collapse]Providing Data
     [Expand]Add Vector Items Manually
     [Expand]Load Vector Items from Vector Format Source
      Generate Vector Items Automatically
      Generate Chart Items Automatically
      Provide Data Using Vector Item Attributes
   [Expand]Visual Elements
   [Expand]End-User Interaction
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Provide Data Using Vector Item Attributes

Attributes are used to associate a vector item with supplementary information. The Map Control operates with vector item attributes, allowing you to visualize any kind of data.

A single attribute is represented by the MapItemAttribute object. This object can be accessed as an item of the MapItemAttributeCollection, returned by the MapItem.Attributes property of the MapItem class descendant.

These attributes can be specified in various ways, depending on the approach the Map Control utilizes to obtain vector items. The sections below describe each approach in detail, as well as how to use vector item attributes.

Expanded Manual Creation of Vector Items

When vector items are created manually, you can also specify the attributes for any vector item.

To create an attribute:

The following code shows how this can be done for the Map Bubble Chart.

Expanded Loading Vector Items from a Vector Format File

When the map control obtains vector items from a vector format file using ShapefileDataAdapter, KmlFileDataAdapter or SqlGeometryDataAdapter, vector item attributes are generated automatically.

The following code demonstrates how to load data from a Shapefile.

Expanded Loading Vector Items from a Datasource

If the Map Control obtains vector items from a datasource, the attributes are created by mapping data source fields to vector item attributes.

As a result of vector item mapping, the map control specifies which data field from the data source will be bound to which attribute of DataSourceAdapterBase descendant generated items. The adapter can be accessed using the VectorItemsLayer.Data property.

To create vector item attributes, do the following.

The code below shows how to add Name, Year and Description attributes to the map item attribute mapping collection.

Expanded Using Vector Item Attributes

There are different ways to use vector item attributes in your application.

One of the popular uses of vector item attributes is the displaying of vector data from a datasource in tooltips. To learn how this can be done, see the How to: Create a Map Item Attribute and Show its Value in the Map Tooltip example.

Another example is to color shape contours depending on data associated with a shape. To do this, use the Colorizers. See the How to: Colorize Map Contours Using the Choropleth Colorizer example to learn more.

Expanded See Also

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