[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Collapse]Map Control
   [Expand]Getting Started
    Layers
   [Expand]Coordinate Systems
   [Expand]Map Image Data
   [Expand]GIS Data
   [Expand]Vector Data
   [Expand]Visual Elements
   [Collapse]End-User Interaction
     Highlighting
     Selection
     Tooltips
     Printing and Exporting
     Scrolling and Zooming
   [Expand]Examples
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Selection

The Map control provides the capability to select items on the map surface.

To learn more about selection in maps, refer to the following sections.

Expanded Enable Selection

Set the VectorLayerBase.EnableSelection property to true to allow end users to select vector layer items.

In the case, when it is necessary to display the selected item above other layer items, set the VectorLayerBase.IncreaseItemZIndexInInteraction property to true.

The following table demonstrates the IncreaseZIndexInInteraction property in action.

The property value The resulting image
IncreaseItemZIndexInInteraction = true
IncreaseItemZIndexInInteraction = false

Expanded Access the Selected Items

Specify or obtain a selected item using the VectorLayerBase.SelectedItem property. When the Multiple or Extended selection mode is enabled, it is possible to access selected items using the VectorLayerBase.SelectedItems property.

In addition, you can handle the MapControl.SelectionChanged event to provide specific actions each time the end user selects map control items.

Expanded Selection Modes

The selection behavior is defined by its mode. The MapControl.SelectionMode property specifies which mode is enabled.

  • Single Selection Mode

    Set the SelectionMode property to Single. In this mode, the only single map item can be selected on the Map control surface.

    To select an individual item on a map, perform one of the following actions.

    • Tap a map item on a touchscreen device.
    • Hover over a map item with the mouse pointer and click it.

  • Multiple Selection Mode

    The Map control makes it possible to mark any number of scattered vector items. To use this functionality:

    • set the SelectionMode property to Multiple;
    • select or deselect the desired vector layer items by left-clicking on them.

  • Extended Selection Mode

    The Extended mode joins the Single and Multiple modes functionality. To enable the Extended mode, set the SelectionMode property to Extended.

    • Select/deselect a single map item by left-clicking on it.
    • Select/deselect multiple map items by left-clicking on them while pressing Ctrl key.

Expanded The Selection Rectangle

If necessary, select several map items at the same time using the selection rectangle. For this, perform the following steps.

  • Set the SelectionMode property to Multiple or Extended.
  • Hold the Shift key and left mouse button.
  • Drag the mouse pointer to mark an area that includes the required map items.
  • Release the left mouse button. All map items, falling into this area, will be selected.

Note

Note, it is possible to select or deselect separate map items by left-clicking on them while pressing the Ctrl key.

Expanded Customize the Selected Item Appearance

To configure the appearance of each individual item while it is selected, use the following properties.

Use XAML below to add a MapEllipse object with defined selection settings to a map.

When you need to specify the common appearance settings for all selected items on a vector layer, use the following properties.

Use the XAML below to set the common appearance for selected vector layer items.

Expanded See Also

Is this topic helpful?​​​​​​​