Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Collapse]Map Control
   [Expand]Getting Started
    Layers
   [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
     Colorizers
     Clusterers
   [Expand]Visual Elements
   [Expand]Examples
   [Expand]End-User Features
   [Expand]Product Information
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Generate Vector Items Automatically

Map control allows providing vector items from lists and list sources of objects. To do this, create an instance of the ListSourceDataAdapter class and assign it to the VectorItemsLayer.Data property. Then, assign a list of data objects to its DataSourceAdapterBase.DataSource property.

Then, it is necessary to specify the data object properties that are used to generate vector items. To provide this information, use a MapItemMappingInfo object returned by the ListSourceDataAdapter.Mappings property.

The following image shows the result of binding to data using ListSourceDataAdapter.

When it is necessary to provide additional property values of complex shapes (e.g. MapRectangle, MapHitInfo.MapEllipse), use Property Mappings. To do this, add the MapItemPropertyMappingBase class descendant specifying the required property mapping, to the DataSourceAdapterBase.PropertyMappings collection. The following image demonstrates the result of using property mappings to specify the rectangles' width and height.

Note

If you need to provide additional information for generated vector items (e.g., to display this information in tooltips), specify it using the DataSourceAdapterBase.AttributeMappings property of ListSourceDataAdapter. For detailed information, refer to Provide Data Using Vector Item Attributes.

To learn more on how to bind data using the ListSourceDataAdapter class, refer to How to: Automatically Generate Vector Items from a Datasource.

Expanded See Also

How would you rate this topic?​​​​​​​