Class MapAnnotations
Represents the MapAnnotation class in the SfMap.
Inheritance
Namespace: Syncfusion.UI.Xaml.Maps
Assembly: Syncfusion.SfMaps.WPF.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 |
---|
System.Windows.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 |
---|
System.Windows.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 |
---|
System.Windows.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 |
---|
System.Windows.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 |
---|
System.Windows.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 |
---|
System.Windows.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 |
---|
System.Windows.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 |
---|
System.Windows.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 |
---|
System.Windows.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 |
---|
System.Windows.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 |
---|---|
System.Windows.Media.Brush | Type :System.Windows.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 |
---|---|
System.Windows.Media.FontFamily | Type :System.Windows.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 |
|
AnnotationLabelFontStyle
Gets or sets Font Style of the annotation label in the SfMap.
Declaration
public FontStyle AnnotationLabelFontStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.FontStyle | Type :System.Windows.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 |
---|---|
System.Windows.Media.Brush | Type :System.Windows.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 |
---|---|
System.Windows.UIElement | Type :System.Windows.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 |
---|---|
System.Windows.DataTemplate | Type :System.Windows.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);
}
}
}