MapElement MapElement MapElement MapElement Class

Definition

Represents an element displayed on a MapControl.

public : class MapElement : DependencyObject, IMapElement, IMapElement2public class MapElement : DependencyObject, IMapElement, IMapElement2Public Class MapElement Inherits DependencyObject Implements IMapElement, IMapElement2// This API is not available in Javascript.
Inheritance
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Inherited Members

Inherited methods

Inherited properties

Remarks

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

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

Constructors

MapElement() MapElement() MapElement() MapElement()

Initializes a new instance of the MapElement class.

public : MapElement()public MapElement()Public Sub New()// This API is not available in Javascript.

Properties

MapStyleSheetEntry MapStyleSheetEntry MapStyleSheetEntry MapStyleSheetEntry

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

public : PlatForm::String MapStyleSheetEntry { get; set; }public string MapStyleSheetEntry { get; set; }Public ReadWrite Property MapStyleSheetEntry As string// This API is not available in Javascript.
Value
PlatForm::String string string string

The name of the entry in the map's style sheet that you'd like to apply to this MapElement.

Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Examples

string myStyleSheetJson = @"{""version"": ""1.*"",

  ""extensions"":{

    ""myNamespace"":{

      ""myFoodPoint"":{

        ""parent"":""foodPoint"",

        ""scale"":2}}}}";



this.map.StyleSheet = MapStyleSheet.ParseFromJson(myStyleSheetJson);
this.map.MapElements.Add(new MapIcon
{

  Location = new Geopoint(new BasicGeoposition { Latitude = 44, Longitude = -120 }),

  MapStyleSheetEntry = MapStyleSheetEntries.FoodPoint,

});
this.map.MapElements.Add(new MapIcon
{

  Location = new Geopoint(new BasicGeoposition { Latitude = 47, Longitude = -120 }),

  MapStyleSheetEntry = "myNamespace.myFoodPoint",

});

Remarks

Set this property to a string or to any of the property values available in the MapStyleSheetEntries class.

To learn more about entries in a map style sheet, see Map style sheet reference.

MapStyleSheetEntryProperty MapStyleSheetEntryProperty MapStyleSheetEntryProperty MapStyleSheetEntryProperty

Identifies for the MapStyleSheetEntry dependency property.

public : static DependencyProperty MapStyleSheetEntryProperty { get; }public static DependencyProperty MapStyleSheetEntryProperty { get; }Public Static ReadOnly Property MapStyleSheetEntryProperty As DependencyProperty// This API is not available in Javascript.
Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

MapStyleSheetEntryState MapStyleSheetEntryState MapStyleSheetEntryState 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.

public : PlatForm::String MapStyleSheetEntryState { get; set; }public string MapStyleSheetEntryState { get; set; }Public ReadWrite Property MapStyleSheetEntryState As string// This API is not available in Javascript.
Value
PlatForm::String string string string

The name of the state of this MapElement.

Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Examples

string myStyleSheetJson = @"{""version"": ""1.*"",

  ""extensions"":{

    ""myNamespace"":{

      ""myState"":{

        ""fillColor"":""#FF0000""}}}}";



this.map.StyleSheet = MapStyleSheet.ParseFromJson(myStyleSheetJson);
this.map.MapElements.Add(new MapIcon
{

  Location = new Geopoint(new BasicGeoposition { Latitude = 44, Longitude = -120 }),

  MapStyleSheetEntry = MapStyleSheetEntries.FoodPoint,

  MapStyleSheetEntryState = MapStyleSheetEntryStates.Selected,

});
this.map.MapElements.Add(new MapIcon
{

  Location = new Geopoint(new BasicGeoposition { Latitude = 47, Longitude = -120 }),

  MapStyleSheetEntry = MapStyleSheetEntries.FoodPoint,

  MapStyleSheetEntryState = "myNamespace.myState",

});

Remarks

Set this property to a string or to any of the property values available in the MapStyleSheetEntryStates class.

To learn more about entries in a map style sheet, see Map style sheet reference.

MapStyleSheetEntryStateProperty MapStyleSheetEntryStateProperty MapStyleSheetEntryStateProperty MapStyleSheetEntryStateProperty

Identifies for the MapStyleSheetEntryState dependency property.

public : static DependencyProperty MapStyleSheetEntryStateProperty { get; }public static DependencyProperty MapStyleSheetEntryStateProperty { get; }Public Static ReadOnly Property MapStyleSheetEntryStateProperty As DependencyProperty// This API is not available in Javascript.
Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

MapTabIndex MapTabIndex MapTabIndex 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.

public : int MapTabIndex { get; set; }public int MapTabIndex { get; set; }Public ReadWrite Property MapTabIndex As int// This API is not available in Javascript.
Value
int int int int

A value that determines the order of logical navigation across elements in a MapControl.

MapTabIndexProperty MapTabIndexProperty MapTabIndexProperty MapTabIndexProperty

Identifies the MapTabIndex dependency property.

public : static DependencyProperty MapTabIndexProperty { get; }public static DependencyProperty MapTabIndexProperty { get; }Public Static ReadOnly Property MapTabIndexProperty As DependencyProperty// This API is not available in Javascript.
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the MapTabIndex dependency property.

Tag Tag Tag Tag

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

public : PlatForm::Object Tag { get; set; }public object Tag { get; set; }Public ReadWrite Property Tag As object// This API is not available in Javascript.
Value
PlatForm::Object object object object

An arbitrary object value that can be used to store custom information about this object.

Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

TagProperty TagProperty TagProperty TagProperty

Identifies the Tag dependency property.

public : static DependencyProperty TagProperty { get; }public static DependencyProperty TagProperty { get; }Public Static ReadOnly Property TagProperty As DependencyProperty// This API is not available in Javascript.
Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Visible Visible Visible Visible

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

public : PlatForm::Boolean Visible { get; set; }public bool Visible { get; set; }Public ReadWrite Property Visible As bool// This API is not available in Javascript.
Value
PlatForm::Boolean bool bool bool

true if the MapElement is visible on the MapControl; otherwise, false.

VisibleProperty VisibleProperty VisibleProperty VisibleProperty

Identifies the Visible dependency property.

public : static DependencyProperty VisibleProperty { get; }public static DependencyProperty VisibleProperty { get; }Public Static ReadOnly Property VisibleProperty As DependencyProperty// This API is not available in Javascript.
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the Visible dependency property.

ZIndex ZIndex ZIndex 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.

public : int ZIndex { get; set; }public int ZIndex { get; set; }Public ReadWrite Property ZIndex As int// This API is not available in Javascript.
Value
int int int int

The z-index of the MapElement.

ZIndexProperty ZIndexProperty ZIndexProperty ZIndexProperty

Identifies the ZIndex dependency property.

public : static DependencyProperty ZIndexProperty { get; }public static DependencyProperty ZIndexProperty { get; }Public Static ReadOnly Property ZIndexProperty As DependencyProperty// This API is not available in Javascript.
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the ZIndex dependency property.

See Also