Skip to main content

Generate Vector Items Automatically

The map control allows you to create vector items from lists and list sources of objects.

ProvidingData_List_Example

To do this, follow the steps below:

  1. Create an instance of the ListSourceDataAdapter class and assign it to the VectorLayer.Data property.

  2. Assign a list of data objects to the adapter’s DataSource property.

  3. Specify the data object properties that are used to generate vector items. To do so, assign one of the following mapping object to the ListSourceDataAdapter.Mappings property:

    Then, map the MapPointMappingInfoBase.Latitude and MapPointMappingInfoBase.Longitude properties to data object properties that contain latitude and longitude data.

  4. To specify the type of displayed vector items and their settings, assign a MapItemSettings descendant object to the ListSourceDataAdapter.ItemSettings property.

If you need to supply additional information for generated vector items (for example, to display this information in tooltips), specify the ListSourceDataAdapter‘s AttributeMappings property. For more information about vector item attributes, refer to the following topic: Provide Data Using Vector Item Attributes.

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

See Also