menu

UWP

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class MapAnnotations - UWP API Reference | Syncfusion

    Show / Hide Table of Contents

    Class MapAnnotations

    Represents the MapAnnotation class in the SfMap.

    Inheritance
    System.Object
    MapAnnotations
    Namespace: Syncfusion.UI.Xaml.Maps
    Assembly: Syncfusion.SfMaps.UWP.dll
    Syntax
    public class MapAnnotations : DependencyObject
    Examples
    using Syncfusion.UI.Xaml.Maps;
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using Windows.Foundation;
    using Windows.Foundation.Collections;
    using Windows.UI;
    using Windows.UI.Xaml;
    using Windows.UI.Xaml.Controls;
    using Windows.UI.Xaml.Controls.Primitives;
    using Windows.UI.Xaml.Data;
    using Windows.UI.Xaml.Input;
    using Windows.UI.Xaml.Media;
    using Windows.UI.Xaml.Navigation;
    using Windows.UI.Xaml.Shapes;
    
    
    namespace MapApp
    {
        public sealed partial class MainPage : Page
        {
            public MainPage()
            {
                this.InitializeComponent();
                SfMap syncMap = new SfMap();
                ShapeFileLayer layer = new ShapeFileLayer();
                layer.Uri = "MapApp.world1.shp";
                MapAnnotations annotation = new MapAnnotations();
                annotation.AnnotationSymbol = new Rectangle { Height = 50, Width = 50, Fill = new SolidColorBrush(Colors.Aqua) };
                annotation.AnnotationLabel = "SfMap Annotation";
                annotation.Latitude = 30;
                annotation.Longitude = 20;
                annotation.AnnotationLabelBackground = new SolidColorBrush(Colors.Azure);
                annotation.AnnotationLabelFontFamily = new Windows.UI.Xaml.Media.FontFamily("Comic Sans MS");
                annotation.AnnotationLabelFontSize = 10d;
                annotation.AnnotationLabelFontStyle = FontStyle.Normal;
                annotation.AnnotationLabelForeground = new SolidColorBrush(Colors.Black);
                layer.Annotations.Add(annotation);
                syncMap.Layers.Add(layer);
    
            }
    
        }
    
    
    }

    Constructors

    MapAnnotations()

    Initializes a new instance of the MapAnnotations class.

    Declaration
    public MapAnnotations()

    Fields

    AnnotationLabelBackgroundProperty

    // Using a DependencyProperty as the backing store for LabelBackground. This enables animation, styling, binding, etc...

    Declaration
    public static readonly DependencyProperty AnnotationLabelBackgroundProperty
    Field Value
    Type
    Windows.UI.Xaml.DependencyProperty

    AnnotationLabelFontFamilyProperty

    // Using a DependencyProperty as the backing store for LabelFontFamily. This enables animation, styling, binding, etc...

    Declaration
    public static readonly DependencyProperty AnnotationLabelFontFamilyProperty
    Field Value
    Type
    Windows.UI.Xaml.DependencyProperty

    AnnotationLabelFontSizeProperty

    // Using a DependencyProperty as the backing store for LabelFontSize. This enables animation, styling, binding, etc...

    Declaration
    public static readonly DependencyProperty AnnotationLabelFontSizeProperty
    Field Value
    Type
    Windows.UI.Xaml.DependencyProperty

    AnnotationLabelFontStyleProperty

    // Using a DependencyProperty as the backing store for LabelFontStyle. This enables animation, styling, binding, etc...

    Declaration
    public static readonly DependencyProperty AnnotationLabelFontStyleProperty
    Field Value
    Type
    Windows.UI.Xaml.DependencyProperty

    AnnotationLabelForegroundProperty

    // Using a DependencyProperty as the backing store for LabelForeground. This enables animation, styling, binding, etc...

    Declaration
    public static readonly DependencyProperty AnnotationLabelForegroundProperty
    Field Value
    Type
    Windows.UI.Xaml.DependencyProperty

    AnnotationLabelProperty

    // Using a DependencyProperty as the backing store for SymbolText. This enables animation, styling, binding, etc...

    Declaration
    public static readonly DependencyProperty AnnotationLabelProperty
    Field Value
    Type
    Windows.UI.Xaml.DependencyProperty

    AnnotationSymbolProperty

    // Using a DependencyProperty as the backing store for Symbol. This enables animation, styling, binding, etc...

    Declaration
    public static readonly DependencyProperty AnnotationSymbolProperty
    Field Value
    Type
    Windows.UI.Xaml.DependencyProperty

    AnnotationTemplateProperty

    // Using a DependencyProperty as the backing store for SymbolTemplate. This enables animation, styling, binding, etc...

    Declaration
    public static readonly DependencyProperty AnnotationTemplateProperty
    Field Value
    Type
    Windows.UI.Xaml.DependencyProperty

    LatitudeProperty

    // Using a DependencyProperty as the backing store for Latitude. This enables animation, styling, binding, etc...

    Declaration
    public static readonly DependencyProperty LatitudeProperty
    Field Value
    Type
    Windows.UI.Xaml.DependencyProperty

    LongitudeProperty

    // Using a DependencyProperty as the backing store for Longitude. This enables animation, styling, binding, etc...

    Declaration
    public static readonly DependencyProperty LongitudeProperty
    Field Value
    Type
    Windows.UI.Xaml.DependencyProperty

    Properties

    AnnotationLabel

    Gets or set the display label for the Annotations.

    Declaration
    public string AnnotationLabel { get; set; }
    Property Value
    Type Description
    System.String

    Type :System.String

    Remarks

    Use this property to set the display any text on the annotation.

    Examples
    using Syncfusion.UI.Xaml.Maps;
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using Windows.Foundation;
    using Windows.Foundation.Collections;
    using Windows.UI;
    using Windows.UI.Xaml;
    using Windows.UI.Xaml.Controls;
    using Windows.UI.Xaml.Controls.Primitives;
    using Windows.UI.Xaml.Data;
    using Windows.UI.Xaml.Input;
    using Windows.UI.Xaml.Media;
    using Windows.UI.Xaml.Navigation;
    using Windows.UI.Xaml.Shapes;
    
    
    namespace MapApp
    {
        public sealed partial class MainPage : Page
        {
            public MainPage()
            {
                this.InitializeComponent();
                SfMap syncMap = new SfMap();           
                ShapeFileLayer layer = new ShapeFileLayer();
                layer.Uri = "MapApp.world1.shp";
                MapAnnotations annotation = new MapAnnotations();
                annotation.AnnotationSymbol = new Rectangle { Height=50, Width=50, Fill=new SolidColorBrush(Colors.Aqua) };
                annotation.AnnotationLabel = "SfMap Annotation";
                annotation.Latitude = 30;
                annotation.Longitude = 20;
                annotation.AnnotationLabelBackground = new SolidColorBrush(Colors.Azure);
                annotation.AnnotationLabelFontFamily = new Windows.UI.Xaml.Media.FontFamily("Comic Sans MS");
                annotation.AnnotationLabelFontSize = 10d;
                annotation.AnnotationLabelFontStyle = FontStyle.Normal;
                annotation.AnnotationLabelForeground = new SolidColorBrush(Colors.Black);
                layer.Annotations.Add(annotation);
                syncMap.Layers.Add(layer);
            }
        }
    }

    AnnotationLabelBackground

    Gets or sets Background color of the annotation label.

    Declaration
    public Brush AnnotationLabelBackground { get; set; }
    Property Value
    Type Description
    Windows.UI.Xaml.Media.Brush

    Type :Windows.UI.Xaml.Media.Brush

    Remarks

    Use this property to set the background color of the annotation label.

    Examples
    using Syncfusion.UI.Xaml.Maps;
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using Windows.Foundation;
    using Windows.Foundation.Collections;
    using Windows.UI;
    using Windows.UI.Xaml;
    using Windows.UI.Xaml.Controls;
    using Windows.UI.Xaml.Controls.Primitives;
    using Windows.UI.Xaml.Data;
    using Windows.UI.Xaml.Input;
    using Windows.UI.Xaml.Media;
    using Windows.UI.Xaml.Navigation;
    using Windows.UI.Xaml.Shapes;
    
    
    namespace MapApp
    {
        public sealed partial class MainPage : Page
        {
            public MainPage()
            {
                this.InitializeComponent();
                SfMap syncMap = new SfMap();           
                ShapeFileLayer layer = new ShapeFileLayer();
                layer.Uri = "MapApp.world1.shp";
                MapAnnotations annotation = new MapAnnotations();
                annotation.AnnotationSymbol = new Rectangle { Height=50, Width=50, Fill=new SolidColorBrush(Colors.Aqua) };
                annotation.AnnotationLabel = "SfMap Annotation";
                annotation.Latitude = 30;
                annotation.Longitude = 20;
                annotation.AnnotationLabelBackground = new SolidColorBrush(Colors.Azure);
                annotation.AnnotationLabelFontFamily = new Windows.UI.Xaml.Media.FontFamily("Comic Sans MS");
                annotation.AnnotationLabelFontSize = 10d;
                annotation.AnnotationLabelFontStyle = FontStyle.Normal;
                annotation.AnnotationLabelForeground = new SolidColorBrush(Colors.Black);
                layer.Annotations.Add(annotation);
                syncMap.Layers.Add(layer);
            }
        }
    }

    AnnotationLabelFontFamily

    Gets or sets the font family of the Labels annotation.

    Declaration
    public FontFamily AnnotationLabelFontFamily { get; set; }
    Property Value
    Type Description
    Windows.UI.Xaml.Media.FontFamily

    Type :Windows.UI.Xaml.Media.FontFamily

    Remarks

    Use this property to set the Font family for the map annotations.

    Examples
    using Syncfusion.UI.Xaml.Maps;
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using Windows.Foundation;
    using Windows.Foundation.Collections;
    using Windows.UI;
    using Windows.UI.Xaml;
    using Windows.UI.Xaml.Controls;
    using Windows.UI.Xaml.Controls.Primitives;
    using Windows.UI.Xaml.Data;
    using Windows.UI.Xaml.Input;
    using Windows.UI.Xaml.Media;
    using Windows.UI.Xaml.Navigation;
    using Windows.UI.Xaml.Shapes;
    
    
    namespace MapApp
    {
        public sealed partial class MainPage : Page
        {
            public MainPage()
            {
                this.InitializeComponent();
                SfMap syncMap = new SfMap();           
                ShapeFileLayer layer = new ShapeFileLayer();
                layer.Uri = "MapApp.world1.shp";
                MapAnnotations annotation = new MapAnnotations();
                annotation.AnnotationSymbol = new Rectangle { Height=50, Width=50, Fill=new SolidColorBrush(Colors.Aqua) };
                annotation.AnnotationLabel = "SfMap Annotation";
                annotation.Latitude = 30;
                annotation.Longitude = 20;
                annotation.AnnotationLabelBackground = new SolidColorBrush(Colors.Azure);
                annotation.AnnotationLabelFontFamily = new Windows.UI.Xaml.Media.FontFamily("Comic Sans MS");
                annotation.AnnotationLabelFontSize = 10d;
                annotation.AnnotationLabelFontStyle = FontStyle.Normal;
                annotation.AnnotationLabelForeground = new SolidColorBrush(Colors.Black);
                layer.Annotations.Add(annotation);
                syncMap.Layers.Add(layer);
            }
        }
    }

    AnnotationLabelFontSize

    Gets or sets the font size of the annotation label in the SfMap.

    Declaration
    public double AnnotationLabelFontSize { get; set; }
    Property Value
    Type Description
    System.Double
    using Syncfusion.UI.Xaml.Maps;
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using Windows.Foundation;
    using Windows.Foundation.Collections;
    using Windows.UI;
    using Windows.UI.Xaml;
    using Windows.UI.Xaml.Controls;
    using Windows.UI.Xaml.Controls.Primitives;
    using Windows.UI.Xaml.Data;
    using Windows.UI.Xaml.Input;
    using Windows.UI.Xaml.Media;
    using Windows.UI.Xaml.Navigation;
    using Windows.UI.Xaml.Shapes;
    
    
    namespace MapApp
    {
        public sealed partial class MainPage : Page
        {
            public MainPage()
            {
                this.InitializeComponent();
                SfMap syncMap = new SfMap();           
                ShapeFileLayer layer = new ShapeFileLayer();
                layer.Uri = "MapApp.world1.shp";
                MapAnnotations annotation = new MapAnnotations();
                annotation.AnnotationSymbol = new Rectangle { Height=50, Width=50, Fill=new SolidColorBrush(Colors.Aqua) };
                annotation.AnnotationLabel = "SfMap Annotation";
                annotation.Latitude = 30;
                annotation.Longitude = 20;
                annotation.AnnotationLabelBackground = new SolidColorBrush(Colors.Azure);
                annotation.AnnotationLabelFontFamily = new Windows.UI.Xaml.Media.FontFamily("Comic Sans MS");
                annotation.AnnotationLabelFontSize = 10d;
                annotation.AnnotationLabelFontStyle = FontStyle.Normal;
                annotation.AnnotationLabelForeground = new SolidColorBrush(Colors.Black);
                layer.Annotations.Add(annotation);
                syncMap.Layers.Add(layer);
            }
        }
    }

    AnnotationLabelFontStyle

    Gets or sets Font Style of the annotation label in the SfMap.

    Declaration
    public FontStyle AnnotationLabelFontStyle { get; set; }
    Property Value
    Type Description
    Windows.UI.Text.FontStyle

    Type :Windows.UI.Text.FontStyle

    Remarks

    Use this property to set the font style of the annotation label.

    Examples
    using Syncfusion.UI.Xaml.Maps;
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using Windows.Foundation;
    using Windows.Foundation.Collections;
    using Windows.UI;
    using Windows.UI.Xaml;
    using Windows.UI.Xaml.Controls;
    using Windows.UI.Xaml.Controls.Primitives;
    using Windows.UI.Xaml.Data;
    using Windows.UI.Xaml.Input;
    using Windows.UI.Xaml.Media;
    using Windows.UI.Xaml.Navigation;
    using Windows.UI.Xaml.Shapes;
    
    
    namespace MapApp
    {
        public sealed partial class MainPage : Page
        {
            public MainPage()
            {
                this.InitializeComponent();
                SfMap syncMap = new SfMap();           
                ShapeFileLayer layer = new ShapeFileLayer();
                layer.Uri = "MapApp.world1.shp";
                MapAnnotations annotation = new MapAnnotations();
                annotation.AnnotationSymbol = new Rectangle { Height=50, Width=50, Fill=new SolidColorBrush(Colors.Aqua) };
                annotation.AnnotationLabel = "SfMap Annotation";
                annotation.Latitude = 30;
                annotation.Longitude = 20;
                annotation.AnnotationLabelBackground = new SolidColorBrush(Colors.Azure);
                annotation.AnnotationLabelFontFamily = new Windows.UI.Xaml.Media.FontFamily("Comic Sans MS");
                annotation.AnnotationLabelFontSize = 10d;
                annotation.AnnotationLabelFontStyle = FontStyle.Normal;
                annotation.AnnotationLabelForeground = new SolidColorBrush(Colors.Black);
                layer.Annotations.Add(annotation);
                syncMap.Layers.Add(layer);
            }
        }
    }

    AnnotationLabelForeground

    Gets or sets the Foreground Color for the Labels on the annotation.

    Declaration
    public Brush AnnotationLabelForeground { get; set; }
    Property Value
    Type Description
    Windows.UI.Xaml.Media.Brush

    Type :Windows.UI.Xaml.Media.Brush

    Remarks

    Use this property to set the foreground color for the annotation label.

    Examples
    using Syncfusion.UI.Xaml.Maps;
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using Windows.Foundation;
    using Windows.Foundation.Collections;
    using Windows.UI;
    using Windows.UI.Xaml;
    using Windows.UI.Xaml.Controls;
    using Windows.UI.Xaml.Controls.Primitives;
    using Windows.UI.Xaml.Data;
    using Windows.UI.Xaml.Input;
    using Windows.UI.Xaml.Media;
    using Windows.UI.Xaml.Navigation;
    using Windows.UI.Xaml.Shapes;
    
    
    namespace MapApp
    {
        public sealed partial class MainPage : Page
        {
            public MainPage()
            {
                this.InitializeComponent();
                SfMap syncMap = new SfMap();           
                ShapeFileLayer layer = new ShapeFileLayer();
                layer.Uri = "MapApp.world1.shp";
                MapAnnotations annotation = new MapAnnotations();
                annotation.AnnotationSymbol = new Rectangle { Height=50, Width=50, Fill=new SolidColorBrush(Colors.Aqua) };
                annotation.AnnotationLabel = "SfMap Annotation";
                annotation.Latitude = 30;
                annotation.Longitude = 20;
                annotation.AnnotationLabelBackground = new SolidColorBrush(Colors.Azure);
                annotation.AnnotationLabelFontFamily = new Windows.UI.Xaml.Media.FontFamily("Comic Sans MS");
                annotation.AnnotationLabelFontSize = 10d;
                annotation.AnnotationLabelFontStyle = FontStyle.Normal;
                annotation.AnnotationLabelForeground = new SolidColorBrush(Colors.Black);
                layer.Annotations.Add(annotation);
                syncMap.Layers.Add(layer);
            }
        }
    }

    AnnotationSymbol

    Gets or sets the Symbol to be displayed on the Annotation.

    Declaration
    public UIElement AnnotationSymbol { get; set; }
    Property Value
    Type Description
    Windows.UI.Xaml.UIElement

    Type :Windows.UI.Xaml.UIElement

    Remarks

    Use this property to set the symbol for the annotation.

    Examples
    using Syncfusion.UI.Xaml.Maps;
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using Windows.Foundation;
    using Windows.Foundation.Collections;
    using Windows.UI;
    using Windows.UI.Xaml;
    using Windows.UI.Xaml.Controls;
    using Windows.UI.Xaml.Controls.Primitives;
    using Windows.UI.Xaml.Data;
    using Windows.UI.Xaml.Input;
    using Windows.UI.Xaml.Media;
    using Windows.UI.Xaml.Navigation;
    using Windows.UI.Xaml.Shapes;
    
    
    namespace MapApp
    {
        public sealed partial class MainPage : Page
        {
            public MainPage()
            {
                this.InitializeComponent();
                SfMap syncMap = new SfMap();           
                ShapeFileLayer layer = new ShapeFileLayer();
                layer.Uri = "MapApp.world1.shp";
                MapAnnotations annotation = new MapAnnotations();
                annotation.AnnotationSymbol = new Rectangle { Height=50, Width=50, Fill=new SolidColorBrush(Colors.Aqua) };
                annotation.AnnotationLabel = "SfMap Annotation";
                annotation.Latitude = 30;
                annotation.Longitude = 20;
                annotation.AnnotationLabelBackground = new SolidColorBrush(Colors.Azure);
                annotation.AnnotationLabelFontFamily = new Windows.UI.Xaml.Media.FontFamily("Comic Sans MS");
                annotation.AnnotationLabelFontSize = 10d;
                annotation.AnnotationLabelFontStyle = FontStyle.Normal;
                annotation.AnnotationLabelForeground = new SolidColorBrush(Colors.Black);
                layer.Annotations.Add(annotation);
                syncMap.Layers.Add(layer);
    
            }
    
        }
    
    
    }

    AnnotationTemplate

    Gets template for the map annotations.

    Declaration
    public DataTemplate AnnotationTemplate { get; }
    Property Value
    Type Description
    Windows.UI.Xaml.DataTemplate

    Type :Windows.UI.Xaml.DataTemplate

    Remarks

    This is read-only property to read the template for annotations.

    Latitude

    Gets or sets the Latitude coordinate of the Annotation.

    Declaration
    public double Latitude { get; set; }
    Property Value
    Type Description
    System.Double

    Type :System.Double

    Remarks

    Use this property to arrange the annotation in the particular latitude coordinate.

    Examples
    using Syncfusion.UI.Xaml.Maps;
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using Windows.Foundation;
    using Windows.Foundation.Collections;
    using Windows.UI;
    using Windows.UI.Xaml;
    using Windows.UI.Xaml.Controls;
    using Windows.UI.Xaml.Controls.Primitives;
    using Windows.UI.Xaml.Data;
    using Windows.UI.Xaml.Input;
    using Windows.UI.Xaml.Media;
    using Windows.UI.Xaml.Navigation;
    using Windows.UI.Xaml.Shapes;
    
    
    namespace MapApp
    {
        public sealed partial class MainPage : Page
        {
            public MainPage()
            {
                this.InitializeComponent();
                SfMap syncMap = new SfMap();           
                ShapeFileLayer layer = new ShapeFileLayer();
                layer.Uri = "MapApp.world1.shp";
                MapAnnotations annotation = new MapAnnotations();
                annotation.AnnotationSymbol = new Rectangle { Height=50, Width=50, Fill=new SolidColorBrush(Colors.Aqua) };
                annotation.AnnotationLabel = "SfMap Annotation";
                annotation.Latitude = 30;
                annotation.Longitude = 20;
                annotation.AnnotationLabelBackground = new SolidColorBrush(Colors.Azure);
                annotation.AnnotationLabelFontFamily = new Windows.UI.Xaml.Media.FontFamily("Comic Sans MS");
                annotation.AnnotationLabelFontSize = 10d;
                annotation.AnnotationLabelFontStyle = FontStyle.Normal;
                annotation.AnnotationLabelForeground = new SolidColorBrush(Colors.Black);
                layer.Annotations.Add(annotation);
                syncMap.Layers.Add(layer);
    
            }
    
        }
    
    }

    Longitude

    Gets or set the Longitude coordinate of the Annotation.

    Declaration
    public double Longitude { get; set; }
    Property Value
    Type Description
    System.Double

    Type :System.Double

    Remarks

    Use this property to arrange the annotation in the particular longitude coordinate.

    Examples
    using Syncfusion.UI.Xaml.Maps;
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using Windows.Foundation;
    using Windows.Foundation.Collections;
    using Windows.UI;
    using Windows.UI.Xaml;
    using Windows.UI.Xaml.Controls;
    using Windows.UI.Xaml.Controls.Primitives;
    using Windows.UI.Xaml.Data;
    using Windows.UI.Xaml.Input;
    using Windows.UI.Xaml.Media;
    using Windows.UI.Xaml.Navigation;
    using Windows.UI.Xaml.Shapes;
    
    
    namespace MapApp
    {
        public sealed partial class MainPage : Page
        {
            public MainPage()
            {
                this.InitializeComponent();
                SfMap syncMap = new SfMap();           
                ShapeFileLayer layer = new ShapeFileLayer();
                layer.Uri = "MapApp.world1.shp";
                MapAnnotations annotation = new MapAnnotations();
                annotation.AnnotationSymbol = new Rectangle { Height=50, Width=50, Fill=new SolidColorBrush(Colors.Aqua) };
                annotation.AnnotationLabel = "SfMap Annotation";
                annotation.Latitude = 30;
                annotation.Longitude = 20;
                annotation.AnnotationLabelBackground = new SolidColorBrush(Colors.Azure);
                annotation.AnnotationLabelFontFamily = new Windows.UI.Xaml.Media.FontFamily("Comic Sans MS");
                annotation.AnnotationLabelFontSize = 10d;
                annotation.AnnotationLabelFontStyle = FontStyle.Normal;
                annotation.AnnotationLabelForeground = new SolidColorBrush(Colors.Black);
                layer.Annotations.Add(annotation);
                syncMap.Layers.Add(layer);
            }
        }
    }

    Extension Methods

    DateTimeExtension.ToDateTime(Object)
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved