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

Distance and Scale

The RadMap uses two measure units for distance - mile and kilometer. The measure units are need for the placement of the MapShapes, as their width and height are measured in the selected unit. To choose the most suitable unit you have to set the DistanceUnit property of the RadMap.

The default DistanceUnit is Kilometer.

<telerik:RadMap x:Name="radMap" 
                DistanceUnit="Mile" /> 

The DistanceUnit also affects the Scale control displayed at the lower right corner of the RadMap.

If you want to hide it, you just have to set the ScaleVisibility property to False.

<telerik:RadMap x:Name="radMap" 
                ScaleVisibility="Collapsed" /> 

The UI control is represented by the MapScale control. You are able to use it outside the RadMap and place it somewhere around it. In this case you have to either hide the original one by using the ScaleVisibility property of the RadMap or the UseDefaultLayout one.

Setting the UseDefaultLayout property to False will hide all of the UI controls inside the RadMap. To learn more read here.

In order to use the MapScale outside the RadMap you have to set its MapControl property to the respective RadMap instance. Additionally you can modify its appearance.

Here is an example:

When using an outside MapScale control, it's the value of the DistanceUnit property of this control that will be counted, not the one of the RadMap's DistanceUnit property.

<StackPanel> 
    <telerik:MapScale MapControl="{Binding ElementName=radMap}" 
                        ScaleLabelBackground="Orange" 
                        ScaleLabelBorderBrush="DarkRed" 
                        BorderBrush="DarkRed" 
                        Background="Orange" 
                        Foreground="DarkRed" 
                        HorizontalAlignment="Right" 
                        Margin="10" 
                        DistanceUnit="Kilometer" /> 
    <telerik:RadMap x:Name="radMap" 
                    Width="600" 
                    Height="480" 
                    ScaleVisibility="Collapsed" /> 
</StackPanel> 

Here is a snapshot of the result:

WPF RadMap Distance and Scale

See Also

In this article