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 和 Streetside 檢視顯示地圖

適用於

另請參閱