Back to Devexpress

Highlighting

wpf-116899-controls-and-libraries-map-control-end-user-interaction-highlighting.md

latest4.0 KB
Original Source

Highlighting

  • Aug 06, 2020
  • 2 minutes to read

The Map control supports map vector item highlighting.

This topic consists of the following sections.

Enable Highlighting

To enable the highlighting functionality, set the VectorLayerBase.EnableHighlighting property to true.

When you need to display the highlighted item above other layer items, set the VectorLayerBase.IncreaseItemZIndexInInteraction property to true.

The following images represent this property in action.

The property valueThe resulting image
IncreaseItemZIndexInInteraction = true
IncreaseItemZIndexInInteraction = false

Customize the Highlighted Item Appearance

To configure the highlight appearance of an individual map item, use the following properties.

Use XAML below to add a MapEllipse object with defined highlighting settings to a VectorLayer.

xaml
<dxm:VectorLayer>
      <dxm:MapItemStorage>
            <dxm:MapEllipse Location="70, -33" 
                     Width="3500" Height="3500" 
                     Fill="AliceBlue" 
                     HighlightFill="Red" 
                     HighlightStroke="Black">
                     <dxm:MapEllipse.HighlightStrokeStyle>
                             <dxm:StrokeStyle DashArray="10 1 5" 
                                     Thickness="5" 
                                     DashCap="Round"/>
                             </dxm:MapEllipse.HighlightStrokeStyle>
            </dxm:MapEllipse>
      </dxm:MapItemStorage>
</dxm:VectorLayer>

If you need to define the highlight appearance of all vector layer items, use the following properties.

Use the XAML below to set the common appearance settings to all vector layer items while they are highlighted.

xaml
<dxm:VectorLayer 
      HighlightShapeFill="Coral" 
      HighlightShapeStroke="Black">
      <dxm:VectorLayer.HighlightShapeStrokeStyle>
            <dxm:StrokeStyle DashArray="1 3" 
                 Thickness="2" 
                 DashCap="Round"/>
      </dxm:VectorLayer.HighlightShapeStrokeStyle>
      <!--…-->
</dxm:VectorLayer>

See Also

Map Selection

Layers