New to Telerik UI for WinUI? Download free 30-day trial

Click Modes

The RadMap supports both single and double mouse clicks. It provides you with a predefined behaviors for them out of the box. The possible values are to be found in the MouseBehavior enumeration:

  • Center: Positions the clicked or double clicked point into the center of the map.

  • None: The click or double click does nothing.

  • ZoomPointToCenter: Zooms in to the clicked or double clicked point and positions it into the center of the map.

  • ZoomToPoint: Zooms in to the clicked or double clicked point.

In order to configure the behavior for the single click you have to set the MouseClickMode property. For the double click mode set the MouseDoubleClickMode property.

You can access the RadMap controls through an alias pointing to the Telerik.UI.Xaml.Controls.DataVisualization.Map namespace: xmlns:telerikMap="using:Telerik.UI.Xaml.Controls.DataVisualization.Map"

Example 1: Change Click Mode

<dataVisualization:RadMap x:Name="radMap" 
                MouseClickMode="Center" 
                MouseDoubleClickMode="ZoomToPoint" / 
If you want to implement a custom behavior for one or both of them, just set the respective mode to None and handle the respective event:

Also you can set these properties to None in order to prevent the users from zooming. Additionally setting the MouseDragMode property to None will disable them from panning.

Example 2

<dataVisualization:RadMap x:Name="radMap" 
                MouseClickMode="None" 
                MouseDoubleClickMode="None" 
                MapMouseClick="radMap_MapMouseClick" 
                MapMouseDoubleClick="radMap_MapMouseDoubleClick" /> 

Example 3

private void radMap_MapMouseClick( object sender, MapMouseRoutedEventArgs e ) 
{ 
    //implement logic regarding single click here 
} 
private void radMap_MapMouseDoubleClick( object sender, MapMouseRoutedEventArgs e ) 
{ 
    //implement logic regarding double click here 
} 

See Also

In this article
Not finding the help you need?