Back to Devexpress

MapItemsLayerBase.EnableHighlighting Property

windowsforms-devexpress-dot-xtramap-dot-mapitemslayerbase-376c513b.md

latest4.6 KB
Original Source

MapItemsLayerBase.EnableHighlighting Property

Specifies whether highlighting map items is enabled on this layer.

Namespace : DevExpress.XtraMap

Assembly : DevExpress.XtraMap.v25.2.dll

NuGet Package : DevExpress.Win.Map

Declaration

csharp
[DefaultValue(true)]
public bool EnableHighlighting { get; set; }
vb
<DefaultValue(True)>
Public Property EnableHighlighting As Boolean

Property Value

TypeDefaultDescription
Booleantrue

true if highlighting of map items is enabled; otherwise, false.

|

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 snippet (auto-collected from DevExpress Examples) contains a reference to the EnableHighlighting 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-dashboard-custom-items-extension/CS/CustomItemExtension/CustomItems/WaypointMap/WaypointMapItemControlProvider.cs#L115

csharp
map.SelectionMode = ElementSelectionMode.None;
vectorLayer.EnableHighlighting = false;
return;

winforms-dashboard-custom-items-extension/VB/CustomItemExtension/CustomItems/WaypointMap/WaypointMapItemControlProvider.vb#L125

vb
map.SelectionMode = ElementSelectionMode.None
vectorLayer.EnableHighlighting = False
Return

See Also

MapItemsLayerBase Class

MapItemsLayerBase Members

DevExpress.XtraMap Namespace