Skip to main content

MapPointer.Text Property

Gets or sets the text for a map pointer.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v23.2.dll

NuGet Package: DevExpress.Win.Map

Declaration

[DefaultValue("")]
public string Text { get; set; }

Property Value

Type Default Description
String String.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:

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);
}
See Also