MapElement Class

Definition

Represents an element displayed on a MapControl.

/// [Windows.Foundation.Metadata.Composable(Windows.UI.Xaml.Controls.Maps.IMapElementFactory, Windows.Foundation.Metadata.CompositionType.Public, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Static(Windows.UI.Xaml.Controls.Maps.IMapElementStatics, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Static(Windows.UI.Xaml.Controls.Maps.IMapElementStatics2, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.WebHostHidden]
class MapElement : DependencyObject
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.WebHostHidden]
/// [Windows.Foundation.Metadata.Composable(Windows.UI.Xaml.Controls.Maps.IMapElementFactory, Windows.Foundation.Metadata.CompositionType.Public, 65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Static(Windows.UI.Xaml.Controls.Maps.IMapElementStatics2, 65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Static(Windows.UI.Xaml.Controls.Maps.IMapElementStatics, 65536, "Windows.Foundation.UniversalApiContract")]
class MapElement : DependencyObject
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.WebHostHidden]
/// [Windows.Foundation.Metadata.Composable(Windows.UI.Xaml.Controls.Maps.IMapElementFactory, Windows.Foundation.Metadata.CompositionType.Public, 65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Static(Windows.UI.Xaml.Controls.Maps.IMapElementStatics2, 65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Static(Windows.UI.Xaml.Controls.Maps.IMapElementStatics, 65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Static(Windows.UI.Xaml.Controls.Maps.IMapElementStatics3, 327680, "Windows.Foundation.UniversalApiContract")]
class MapElement : DependencyObject
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.WebHostHidden]
/// [Windows.Foundation.Metadata.Composable(Windows.UI.Xaml.Controls.Maps.IMapElementFactory, Windows.Foundation.Metadata.CompositionType.Public, 65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Static(Windows.UI.Xaml.Controls.Maps.IMapElementStatics2, 65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Static(Windows.UI.Xaml.Controls.Maps.IMapElementStatics, 65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Static(Windows.UI.Xaml.Controls.Maps.IMapElementStatics3, 327680, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Static(Windows.UI.Xaml.Controls.Maps.IMapElementStatics4, 393216, "Windows.Foundation.UniversalApiContract")]
class MapElement : DependencyObject
[Windows.Foundation.Metadata.Composable(typeof(Windows.UI.Xaml.Controls.Maps.IMapElementFactory), Windows.Foundation.Metadata.CompositionType.Public, 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Static(typeof(Windows.UI.Xaml.Controls.Maps.IMapElementStatics), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Static(typeof(Windows.UI.Xaml.Controls.Maps.IMapElementStatics2), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.WebHostHidden]
public class MapElement : DependencyObject
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.WebHostHidden]
[Windows.Foundation.Metadata.Composable(typeof(Windows.UI.Xaml.Controls.Maps.IMapElementFactory), Windows.Foundation.Metadata.CompositionType.Public, 65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Static(typeof(Windows.UI.Xaml.Controls.Maps.IMapElementStatics2), 65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Static(typeof(Windows.UI.Xaml.Controls.Maps.IMapElementStatics), 65536, "Windows.Foundation.UniversalApiContract")]
public class MapElement : DependencyObject
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.WebHostHidden]
[Windows.Foundation.Metadata.Composable(typeof(Windows.UI.Xaml.Controls.Maps.IMapElementFactory), Windows.Foundation.Metadata.CompositionType.Public, 65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Static(typeof(Windows.UI.Xaml.Controls.Maps.IMapElementStatics2), 65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Static(typeof(Windows.UI.Xaml.Controls.Maps.IMapElementStatics), 65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Static(typeof(Windows.UI.Xaml.Controls.Maps.IMapElementStatics3), 327680, "Windows.Foundation.UniversalApiContract")]
public class MapElement : DependencyObject
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.WebHostHidden]
[Windows.Foundation.Metadata.Composable(typeof(Windows.UI.Xaml.Controls.Maps.IMapElementFactory), Windows.Foundation.Metadata.CompositionType.Public, 65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Static(typeof(Windows.UI.Xaml.Controls.Maps.IMapElementStatics2), 65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Static(typeof(Windows.UI.Xaml.Controls.Maps.IMapElementStatics), 65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Static(typeof(Windows.UI.Xaml.Controls.Maps.IMapElementStatics3), 327680, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Static(typeof(Windows.UI.Xaml.Controls.Maps.IMapElementStatics4), 393216, "Windows.Foundation.UniversalApiContract")]
public class MapElement : DependencyObject
Public Class MapElement
Inherits DependencyObject
Inheritance
Derived
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

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.
  • Display a 3D model using the MapElement3D class.

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.

Version history

Windows version SDK version Value added
1709 16299 MapStyleSheetEntry
1709 16299 MapStyleSheetEntryState
1709 16299 Tag
1803 17134 IsEnabled

Constructors

MapElement()

Initializes a new instance of the MapElement class.

Properties

Dispatcher

Gets the CoreDispatcher that this object is associated with. The CoreDispatcher represents a facility that can access the DependencyObject on the UI thread even if the code is initiated by a non-UI thread.

Equivalent WinUI property: Microsoft.UI.Xaml.DependencyObject.Dispatcher.

(Inherited from DependencyObject)
IsEnabled

Indicates whether users can interact with the MapElement.

IsEnabledProperty

Identifies the IsEnabled dependency property.

MapStyleSheetEntry

Gets or sets the name of an entry in the map's style sheet that you'd like to apply to this MapElement.

MapStyleSheetEntryProperty

Identifies for the MapStyleSheetEntry dependency property.

MapStyleSheetEntryState

Gets or sets the name of the state of this MapElement. If the style sheet defines a style for that state, that style is applied to this element. Values defined in the style sheet for the state override values defined in the MapStyleSheetEntry.

MapStyleSheetEntryStateProperty

Identifies for the MapStyleSheetEntryState dependency property.

MapTabIndex

Gets or sets a value that determines the order in which elements of the MapControl receive focus when the user navigates through those elements by pressing the Tab key.

MapTabIndexProperty

Identifies the MapTabIndex dependency property.

Tag

Gets or sets an arbitrary object value that can be used to store custom information about this object.

TagProperty

Identifies the Tag dependency property.

Visible

Gets or sets a value that indicates whether the MapElement is visible on the MapControl.

VisibleProperty

Identifies the Visible dependency property.

ZIndex

Gets or sets the z-index of the MapElement. A MapElement with a higher z-index is displayed on top of a MapElement with a lower z-index.

ZIndexProperty

Identifies the ZIndex dependency property.

Methods

ClearValue(DependencyProperty)

Clears the local value of a dependency property.

Equivalent WinUI method: Microsoft.UI.Xaml.DependencyObject.ClearValue.

(Inherited from DependencyObject)
GetAnimationBaseValue(DependencyProperty)

Returns any base value established for a dependency property, which would apply in cases where an animation is not active.

Equivalent WinUI method: Microsoft.UI.Xaml.DependencyObject.GetAnimationBaseValue.

(Inherited from DependencyObject)
GetValue(DependencyProperty)

Returns the current effective value of a dependency property from a DependencyObject.

Equivalent WinUI method: Microsoft.UI.Xaml.DependencyObject.GetValue.

(Inherited from DependencyObject)
ReadLocalValue(DependencyProperty)

Returns the local value of a dependency property, if a local value is set.

Equivalent WinUI method: Microsoft.UI.Xaml.DependencyObject.ReadLocalValue.

(Inherited from DependencyObject)
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

Registers a notification function for listening to changes to a specific DependencyProperty on this DependencyObject instance.

Equivalent WinUI method: Microsoft.UI.Xaml.DependencyObject.RegisterPropertyChangedCallback.

(Inherited from DependencyObject)
SetValue(DependencyProperty, Object)

Sets the local value of a dependency property on a DependencyObject.

Equivalent WinUI method: Microsoft.UI.Xaml.DependencyObject.SetValue.

(Inherited from DependencyObject)
UnregisterPropertyChangedCallback(DependencyProperty, Int64)

Cancels a change notification that was previously registered by calling RegisterPropertyChangedCallback.

Equivalent WinUI method: Microsoft.UI.Xaml.DependencyObject.UnregisterPropertyChangedCallback.

(Inherited from DependencyObject)

Applies to

See also