MapControl.MapElements 属性

定义

获取 MapControl 的子级的 MapElement 对象的集合。

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)

属性值

MapControl 的子级的 MapElement 对象的集合。

注解

注意

在Windows 10 Fall Creators Update,建议将 MapElement 对象添加到 MapElementsLayer,而不是将它们添加到 MapElements 集合。

通过将图钉、图像和形状添加到 MapElements 集合,在 MapControl 上显示它们。

  • 使用 MapIcon 类显示带有可选文本的图像,例如图钉。 保留默认映像或提供自定义映像。
  • 定义并显示 MapPolygonMapPolyline。 或者,若要在 MapControl 上显示 XAML 元素,请将其添加到其 Children 集合。

有关详细信息,请参阅 使用 2D、3D 和街景视图显示地图

适用于

另请参阅