Back to Devexpress

MapItemAttribute Class

windowsforms-devexpress-dot-xtramap-2319c50b.md

latest2.5 KB
Original Source

MapItemAttribute Class

An attribute that can be applied to map items.

Namespace : DevExpress.XtraMap

Assembly : DevExpress.XtraMap.v25.2.dll

NuGet Package : DevExpress.Win.Map

Declaration

csharp
public class MapItemAttribute :
    IMapItemAttribute,
    ISupportObjectChanged
vb
Public Class MapItemAttribute
    Implements IMapItemAttribute,
               ISupportObjectChanged

Remarks

For more information, see Provide Data Using Vector Item Attributes.

Example

csharp
private MapPolygon CreatePolygon(double areaValue, string polygonName, GeoPoint[] points) {
    MapPolygon item = new MapPolygon();

    item.Attributes.Add(new MapItemAttribute() {
        Name = areaValueAttrName,
        Type = typeof(double),
        Value = areaValue
    });
    item.Attributes.Add(new MapItemAttribute() {
        Name = polygonNameAttrName,
        Type = typeof(string),
        Value = polygonName
    });

    item.ToolTipPattern = "{" + polygonNameAttrName + "}=<b>{" + areaValueAttrName + "}</b>";

    foreach (GeoPoint point in points) {
        item.Points.Add(point);
    }

    return item;
}
vb
Private Function CreatePolygon(ByVal areaValue As Double, ByVal polygonName As String, ByVal points() As GeoPoint) As MapPolygon
    Dim item As New MapPolygon()

    item.Attributes.Add(New MapItemAttribute() With {.Name = areaValueAttrName, .Type = GetType(Double), .Value = areaValue})
    item.Attributes.Add(New MapItemAttribute() With {.Name = polygonNameAttrName, .Type = GetType(String), .Value = polygonName})

    item.ToolTipPattern = "{" & polygonNameAttrName & "}=<b>{" & areaValueAttrName & "}</b>"

    For Each point As GeoPoint In points
        item.Points.Add(point)
    Next point

    Return item
End Function

Inheritance

Object MapItemAttribute

See Also

MapItemAttribute Members

DevExpress.XtraMap Namespace