Skip to main content


  • 2 minutes to read

The Map Control displays tooltips for vector items when a user clicks an item. Tooltips can be used to provide map items with additional information.

The following image illustrates a tooltip attached to a vector item generated from a shapefile:



To learn how to obtain data from a shapefile, refer to the ShapefileDataAdapter help topic.

This topic consists of the following sections.

Enable Tooltips

To enable tooltips for a map, set the MapControl.ToolTipEnabled property to true.


Customize the Tooltip Appearance

To configure the tooltip appearance, use the ways described below.

  • When you need to modify tooltip text patterns for all vector layer items, use the VectorLayerBase.ToolTipPattern property.


    The image above shows a tooltip with the name of the country and its population. To do this, enclose the corresponding attributes from vector data files in brackets to define the ToolTipPattern property.

    <dxm:VectorLayer ToolTipPattern="{}{NAME}: {POP_EST}">
  • Use the MapItem.ToolTipPattern property to set a pattern of text displayed in tooltips for each individual vector element. To configure tooltip content, use map item attributes stored in the MapItem.Attributes collection.


    To show vector item attribute data in a tooltip, use the following code.

    <dxm:VectorLayer SelectedShapeFill="#5b9bd5">
                <dxm:MapPolygon ToolTipPattern="{}Triangle Area: {areaValueAttrName}" 
                            <dxm:MapItemAttribute Name="areaValueAttrName" 
                                  Type="{x:Type sys:Double}" 
  • The VectorLayerBase.ToolTipContentTemplate property specifies the presentation of the tooltip content for a vector element.



    To learn how to modify the tooltip content, refer to the How to: Show Tooltips for Map Shapes example.

  • The MapControl.ToolTipTemplate property defines how tooltips will be displayed. Assign a DataTemplate object to this property to configure a custom form of tooltips.



    To learn how to configure a custom map tooltip shape, refer to the How to: Implement a Custom Map Tooltip Shape example.