Share via


MapControl.MapElements Property

Definition

Gets the collection of MapElement objects that are children of the MapControl.

public:
 property IVector<MapElement ^> ^ MapElements { IVector<MapElement ^> ^ get(); };
IVector<MapElement> MapElements();
public IList<MapElement> MapElements { get; }
var iVector = mapControl.mapElements;
Public ReadOnly Property MapElements As IList(Of MapElement)

Property Value

The collection of MapElement objects that are children of the MapControl.

Remarks

Note

In the Windows 10 Fall Creators Update, we recommend that you add MapElement objects to a MapElementsLayer instead of adding them to the MapElements collection.

Display pushpins, images, and shapes on the MapControl by adding them to its MapElements collection.

  • Display an image such as a pushpin with optional text by using the MapIcon class. Keep the default image or provide a custom image.
  • Define and display a MapPolygon or a MapPolyline. Alternately, to display XAML elements on the MapControl, add them to its Children collection.

For more info, see Display maps with 2D, 3D, and Streetside views.

Applies to

See also