Skip to main content
A newer version of this page is available. .

MapItemsLayerBase.EnableSelection Property

Specifies whether selecting map items is enabled on this layer.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v18.2.dll

Declaration

[DefaultValue(true)]
public bool EnableSelection { get; set; }

Property Value

Type Default Description
Boolean **true**

true, if selecting map items is enabled; otherwise, false.

Example

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