This is a migrated thread and some comments may be shown as answers.

RadMap - Cannot bind to Geo_Bounds property of rad map control

1 Answer 105 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Sai asked on 02 Jun 2014, 08:59 PM

I am unable to bind to the Geo_Bounds property of the rad map control.

If that's not possible, would it be possible to calculate the NW and SE Bounds of the map based on the Center and Zoom level (binding works on these 2 properties !!) of the rad map control ?

Sai Dhalli

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 03 Jun 2014, 01:01 PM
Hi Sai,

I've tested binding to the RadMap.GeoBounds property and all things seems to work fine. Here are the XAML and code behind I've used for testing:

<UserControl x:Class="TestMapFeatures.Views.Integration.BindingGeoBounds"
             d:DesignHeight="300" d:DesignWidth="300">
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
        <telerik:RadMap x:Name="radMap"
                        GeoBounds="{Binding GeoBounds}">
                <telerik:OpenStreetMapProvider />
            <telerik:VisualizationLayer Name="visualizationLayer" />
        <Button Grid.Column="1"
            <TextBlock Margin="4,2,4,2"
                       Text="Set geo bounds" />

public class MapViewModel : ViewModelBase
    private LocationRect geoBounds;
    public LocationRect GeoBounds
            return this.geoBounds;
            this.geoBounds = value;

public partial class BindingGeoBounds : UserControl
    private MapViewModel model = new MapViewModel();
    public BindingGeoBounds()
        this.DataContext = model;
    private void SetGeoBounds(object sender, RoutedEventArgs e)
        Location nw = new Location(30, 30);
        Location se = new Location(20, 50);
        this.model.GeoBounds = new LocationRect(nw, se);
        // Show rectangle for the geo bounds.
        // It is not necessary in the real-life applications
        // but demonstrates that binding works and geo bounds
        // are set.
        RectangleData rect = new RectangleData()
            Location = new Telerik.Windows.Controls.Map.Location(30, 30),
            Height = 10,
            Width = 20,
            ShapeFill = new MapShapeFill()
                Stroke = new SolidColorBrush(Colors.Red),
                StrokeThickness = 2

Could you, please, provide us with your solution or with a small sample project which reproduces the problem you have? This will help us better understand your particular case.

Thank you for your cooperation.

Andrey Murzov
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question