MapIcon MapIcon MapIcon MapIcon Class

Definition

Displays an image such as a pushpin with optional text on a MapControl. Use the default image or provide a custom image.

public : sealed class MapIcon : MapElement, IMapIcon, IMapIcon2public sealed class MapIcon : MapElement, IMapIcon, IMapIcon2Public NotInheritable Class MapIcon Inherits MapElement Implements IMapIcon, IMapIcon2// 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.

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

Tip

When you display a MapIcon image that points to a specific location on the map - for example, a pushpin or an arrow - consider setting the value of the NormalizedAnchorPoint property to the approximate location of the pointer on the image. If you leave the value of NormalizedAnchorPoint at its default value of (0, 0), which represents the upper left corner of the image, changes in the ZoomLevel of the map may leave the image pointing to a different location.

Constructors

MapIcon() MapIcon() MapIcon() MapIcon()

Initializes a new instance of the MapIcon class.

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

Properties

CollisionBehaviorDesired CollisionBehaviorDesired CollisionBehaviorDesired CollisionBehaviorDesired

Gets or sets the behavior of a MapIcon when it collides with other map features due to zoom level.

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

The behavior of a MapIcon when it collides with other map features due to zoom level.

CollisionBehaviorDesiredProperty CollisionBehaviorDesiredProperty CollisionBehaviorDesiredProperty CollisionBehaviorDesiredProperty

Identifies the CollisionBehaviorDesired dependency property.

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

Image Image Image Image

Gets or sets the image for the MapIcon. Provide an optional custom image to replace the default point of interest (POI) image.

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

Remarks

The following line of code displays the MapIcon with a custom image saved in the Assets folder of the project.

MapIcon1.Image = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/customicon.png"));

See Also

Location Location Location Location

Gets or sets the geographic location of the MapIcon on the MapControl. The location is the geographic location on the MapControl at which the NormalizedAnchorPoint of the MapIcon is positioned.

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

The geographic location of the MapIcon on the MapControl.

Remarks

If you provide an Alititude and AltitudeReferenceSystem in 3D views, then MapIcon elements added to the MapControl end up being placed underground or floating in space.

See Also

LocationProperty LocationProperty LocationProperty LocationProperty

Identifies the Location dependency property.

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

The identifier for the Location dependency property.

See Also

NormalizedAnchorPoint NormalizedAnchorPoint NormalizedAnchorPoint NormalizedAnchorPoint

Gets or sets the anchor point of the MapIcon. The anchor point is the point on the MapIcon that is positioned at the point on the MapControl specified by the Location property.

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

The anchor point of the MapIcon.

Remarks

When you display a MapIcon image that points to a specific location on the map - for example, a pushpin or an arrow - consider setting the value of the NormalizedAnchorPoint property to the approximate location of the pointer on the image. If you leave the value of NormalizedAnchorPoint at its default value of (0, 0), which represents the upper left corner of the image, changes in the ZoomLevel of the map may leave the image pointing to a different location.

See Also

NormalizedAnchorPointProperty NormalizedAnchorPointProperty NormalizedAnchorPointProperty NormalizedAnchorPointProperty

Identifies the NormalizedAnchorPoint dependency property.

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

Title Title Title Title

Gets or sets the optional text of the MapIcon.

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

The title of the MapIcon.

See Also

TitleProperty TitleProperty TitleProperty TitleProperty

Identifies the Title dependency property.

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

The identifier for the Title dependency property.

See Also

See Also