MapItem.Attributes Property
Gets the attributes for this map item.
Namespace: DevExpress.XtraMap
Assembly: DevExpress.XtraMap.v19.1.dll
Declaration
Property Value
Type | Description |
---|---|
MapItemAttributeCollection | A MapItemAttributeCollection object. |
Remarks
Attributes are used to associate a vector item with supplementary information. A vector item is represented by the MapItemAttribute object. This object can be accessed as an item of the MapItemAttributeCollection object returned by the MapItem.Attributes
property of the MapItem class descendant.
For more information on map item attributes, see Provide Data Using Vector Item Attributes.
Example
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-color-manually-added-shapes-using-the-choropleth-colorizer-e4744
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;
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the Attributes property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.