Providing Vector Items to a Map Control

It is possible to add vector items to a map control manually. To do this, create a VectorItemsLayer object and add it to the MapControl.Layers collection. After this, there are two ways of providing vector items to a map.

Using the Items Property

The VectorItemsLayer.Items property allows you to work with elements of this collection, but does not allow changing the collection itself.

The following image illustrates several MapPushpin items provided to the map, using the VectorItemsLayer.Items property.

Concepts_VectorData_ManuallyGenerate

To learn more on how to manually generate items, refer to How to: Add Vector Items to a Map Using XAML.

Using the ItemsSource Property

The VectorItemsLayer.ItemsSource property allows you to specify the collection of vector items that are displayed by a map.

The following image illustrates several MapCustomElement objects stored in the external source and provided to the vector layer using the VectorItemsLayer.ItemsSource property.

Lesson3_Result

To learn more on how to manually generate items, refer to How to: Bind Vector Item Source to Map Control.

See Also