Back to Devexpress

MapPointer.Text Property

windowsforms-devexpress-dot-xtramap-dot-mappointer-9409b242.md

latest2.9 KB
Original Source

MapPointer.Text Property

Gets or sets the text for a map pointer.

Namespace : DevExpress.XtraMap

Assembly : DevExpress.XtraMap.v25.2.dll

NuGet Package : DevExpress.Win.Map

Declaration

csharp
[DefaultValue("")]
public string Text { get; set; }
vb
<DefaultValue("")>
Public Property Text As String

Property Value

TypeDefaultDescription
StringString.Empty

A string value that is the text for a map pointer.

|

Remarks

The following example specifies text and its settings for a map pushpin:

csharp
using DevExpress.Utils.Svg;
using DevExpress.XtraMap;
//...
private void Form1_Load(object sender, EventArgs e) {
    vectorLayer = new VectorItemsLayer();
    mapControl1.Layers.Add(vectorLayer);

    MapItemStorage storage = new MapItemStorage();
    vectorLayer.Data = storage;

    MapPushpin pushpin = new MapPushpin();
    pushpin.Location = new GeoPoint(51.5074, 0.1278);
    pushpin.Text = "London";
    pushpin.TextColor = Color.Black;
    pushpin.TextGlowColor = Color.White;
    pushpin.SvgImage = SvgImage.FromFile(GetRelativePath("arrow.svg"));
    pushpin.SvgImageSize = new Size(64, 64);
    // If you specify the puspin image, use the TextOrigin property
    // to set the center point position of the text block in relation to the image's top-left corner.
    pushpin.TextOrigin = new Point(32,32);
    storage.Items.Add(pushpin);
}
vb
Imports DevExpress.Utils.Svg
Imports DevExpress.XtraMap
'...
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
    vectorLayer = New VectorItemsLayer()
    mapControl1.Layers.Add(vectorLayer)
    Dim storage As MapItemStorage = New MapItemStorage()
    vectorLayer.Data = storage
    Dim pushpin As MapPushpin = New MapPushpin()
    pushpin.Location = New GeoPoint(51.5074, 0.1278)
    pushpin.Text = "London"
    pushpin.TextColor = Color.Black
    pushpin.TextGlowColor = Color.White
    pushpin.SvgImage = SvgImage.FromFile(GetRelativePath("arrow.svg"))
    pushpin.SvgImageSize = New Size(64, 64)
    ' If you specify the puspin image, use the TextOrigin property
    ' to set the center point position of the text block in relation to the image's top-left corner.
    pushpin.TextOrigin = New Point(32, 32)
    storage.Items.Add(pushpin)
End Sub

See Also

MapPointer Class

MapPointer Members

DevExpress.XtraMap Namespace