Back to Devexpress

ListSourceDataAdapter.DefaultMapItemType Property

windowsforms-devexpress-dot-xtramap-dot-listsourcedataadapter-d3dd6cdc.md

latest5.9 KB
Original Source

ListSourceDataAdapter.DefaultMapItemType Property

Specifies the type of map items to be used by default when generating items from a data source.

Namespace : DevExpress.XtraMap

Assembly : DevExpress.XtraMap.v25.2.dll

NuGet Package : DevExpress.Win.Map

Declaration

csharp
[DefaultValue(MapItemType.Unknown)]
public MapItemType DefaultMapItemType { get; set; }
vb
<DefaultValue(MapItemType.Unknown)>
Public Property DefaultMapItemType As MapItemType

Property Value

TypeDefaultDescription
MapItemTypeUnknown

A MapItemType enumeration value.

|

Available values:

Show 14 items

NameDescription
Unknown

Represents an unknown map item type.

| | Dot |

Represents a map dot.

| | Ellipse |

Represents a map ellipse.

| | Line |

Represents a map line.

| | Path |

Represents a map path.

| | Polygon |

Represents a map polygon.

| | Polyline |

Represents a map polyline.

| | Rectangle |

Represents a map rectangle.

| | Pushpin |

Represents a map pushpin.

| | Custom |

Represents a map custom element.

| | Callout |

Represents a map callout.

| | Bubble |

Represents a Bubble chart.

| | Pie |

Represents a Pie chart.

| | Spline |

Represents a map spline.

|

Example

View Example

csharp
mapControl.Layers.Add(CreateVectorLayer(data));
LayerBase CreateVectorLayer(object data) {
    ListSourceDataAdapter adapter = new ListSourceDataAdapter() {
        DataSource = data,
        DefaultMapItemType = MapItemType.Custom
    };
    adapter.Mappings.Latitude = "Latitude";
    adapter.Mappings.Longitude = "Longitude";

    adapter.AttributeMappings.Add(new MapItemAttributeMapping() {Name = "Name", Member = "Name"});
    adapter.AttributeMappings.Add(new MapItemAttributeMapping() {Name = "Year", Member = "Year"});
    adapter.AttributeMappings.Add(new MapItemAttributeMapping() {Name = "Description", Member = "Description"});

    VectorItemsLayer layer = new VectorItemsLayer() {
        Data = adapter,
        ItemImageIndex = 0,
        EnableSelection = false,
        EnableHighlighting = false,
        ToolTipPattern = "<b>{Name} ({Year})</b>\n{Description}"
    };
    return layer;
}
vb
mapControl.Layers.Add(CreateVectorLayer(data))
Private Function CreateVectorLayer(ByVal data As Object) As LayerBase
    Dim adapter As New ListSourceDataAdapter() With {.DataSource = data, .DefaultMapItemType = MapItemType.Custom}
    adapter.Mappings.Latitude = "Latitude"
    adapter.Mappings.Longitude = "Longitude"

    adapter.AttributeMappings.Add(New MapItemAttributeMapping() With {.Name = "Name", .Member = "Name"})
    adapter.AttributeMappings.Add(New MapItemAttributeMapping() With {.Name = "Year", .Member = "Year"})
    adapter.AttributeMappings.Add(New MapItemAttributeMapping() With {.Name = "Description", .Member = "Description"})

    Dim layer As New VectorItemsLayer() With {.Data = adapter, .ItemImageIndex = 0, .EnableSelection = False, .EnableHighlighting = False, .ToolTipPattern = "<b>{Name} ({Year})</b>" & ControlChars.Lf & "{Description}"}
    Return layer
End Function

The following code snippets (auto-collected from DevExpress Examples) contain references to the DefaultMapItemType 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.

winforms-map-customize-mini-map-layers/CS/MiniMapLayers/Form1.cs#L97

csharp
adapter.Mappings.Longitude = "Longitude";
adapter.DefaultMapItemType = MapItemType.Dot;
adapter.PropertyMappings.Add(

winforms-map-bind-to-xml-data/CS/WinForms_MapControl_ListAdapter/Form1.cs#L80

csharp
adapter.DefaultMapItemType = MapItemType.Dot;

winforms-map-customize-mini-map-layers/VB/MiniMapLayers/Form1.vb#L73

vb
adapter.Mappings.Longitude = "Longitude"
adapter.DefaultMapItemType = DevExpress.XtraMap.MapItemType.Dot
adapter.PropertyMappings.Add(New DevExpress.XtraMap.MapDotSizeMapping() With {.DefaultValue = 10})

winforms-map-bind-to-xml-data/VB/WinForms_MapControl_ListAdapter/Form1.vb#L60

vb
adapter.PropertyMappings.Add(New MapDotSizeMapping() With {.DefaultValue = 8})
adapter.DefaultMapItemType = MapItemType.Dot
Return adapter

See Also

ListSourceDataAdapter Class

ListSourceDataAdapter Members

DevExpress.XtraMap Namespace