Hi,
I'm using RADMap control for WPF to plot the pins based on set of Lats and Longs. But, i need the Optimum Zoomlevel to display in Map. For this i use Setview() method of the rad map. By doing this i always get the Zoomlevel to 1. But, when i click on the button event, the Zoomlevel is setting correctly even if the debug says Zoomlevel =1. Please find my below code and let me know how should i proceed.
MainWindow.xaml
==============
<Window x:Class="RadMapControlStudy.MainWindow"
xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
Title="MainWindow" Height="600" Width="600" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
<Grid>
<telerik:RadMap Height="500" HorizontalAlignment="Left" Margin="3,0,0,0" Name="radMap1" VerticalAlignment="Top" Width="500">
<telerik:InformationLayer x:Name="layer">
</telerik:InformationLayer>
</telerik:RadMap>
<Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="503,282,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />
</Grid>
</Window>
MainWindow.xaml.cs
==================
namespace RadMapControlStudy
{
public partial class MainWindow : Window
{
Location lc1 = new Location(28.066600, -82.381600); //Some LatLong
Location lc2 = new Location(28.066890, -82.381876); //Some LatLong
I'm using RADMap control for WPF to plot the pins based on set of Lats and Longs. But, i need the Optimum Zoomlevel to display in Map. For this i use Setview() method of the rad map. By doing this i always get the Zoomlevel to 1. But, when i click on the button event, the Zoomlevel is setting correctly even if the debug says Zoomlevel =1. Please find my below code and let me know how should i proceed.
MainWindow.xaml
==============
<Window x:Class="RadMapControlStudy.MainWindow"
xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
Title="MainWindow" Height="600" Width="600" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
<Grid>
<telerik:RadMap Height="500" HorizontalAlignment="Left" Margin="3,0,0,0" Name="radMap1" VerticalAlignment="Top" Width="500">
<telerik:InformationLayer x:Name="layer">
</telerik:InformationLayer>
</telerik:RadMap>
<Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="503,282,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />
</Grid>
</Window>
MainWindow.xaml.cs
==================
namespace RadMapControlStudy
{
public partial class MainWindow : Window
{
Location lc1 = new Location(28.066600, -82.381600); //Some LatLong
Location lc2 = new Location(28.066890, -82.381876); //Some LatLong
public MainWindow()
{
InitializeComponent();
radMap1.Provider = new BingMapProvider(MapMode.Road, true, "KeyValue");
layer.Items.Add(lc1);
layer.Items.Add(lc2);
LocationRect lr = new LocationRect(lc1, lc2);
radMap1.SetView(lr);
}
private void button1_Click(object sender, RoutedEventArgs e) //Zoom seems to be working fine when you click the button
{
LocationRect lr1 = new LocationRect(lc1,lc2);
radMap1.SetView(lr1);
}