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

Size of the map

2 Answers 41 Views
Map
This is a migrated thread and some comments may be shown as answers.
Mapi
Top achievements
Rank 1
Mapi asked on 22 Jul 2010, 08:02 AM
Hello everyone!

I am currently trying to display a map in a window using WPF. Unfortunately, I do not succeed in changing the size of the map.
In my WPF view I have two buttons and my RadMap control, and if I manually change the width and height of the RadMap object the buttons disappear but also the zoom control which is supposed to be on the map.

Here is my code:

<Window x:Class="WpfRadMapApplication.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    MinHeight="300" MinWidth="300"
    Height="600" Width="600">
    <Grid HorizontalAlignment="Center" VerticalAlignment="Top">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="10*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Button Grid.Row="0" Grid.Column="0" Name="map24Button" Content="Map24" Margin="5" HorizontalAlignment="Center" Click="map24Button_Click" />
        <Button Grid.Row="1" Grid.Column="0" Name="openStreetMapButton" Content="OpenStreetMap" Margin="5" HorizontalAlignment="Center" Click="openStreetMapButton_Click" />
        <telerik:RadMap Grid.Row="2"
                    Grid.Column="0"
                    Name="radMap"
                    ZoomLevel="0"
                    Center="0,0"
                    Background="White"
                    HorizontalAlignment="Center">
        </telerik:RadMap>
    </Grid>
</Window>

Thanks for your help :)!

2 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 23 Jul 2010, 07:58 AM
Hello Mapi,

You can use "Auto" as Height value in row definitions for buttons and "*" for the map.
The sample code of stretchable layout for a window is the following:
<Window x:Class="WpfRadMapApplication.MainWindow"
    MinHeight="300" MinWidth="300"
    Height="600" Width="600">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Button Grid.Row="0" Grid.Column="0" Name="map24Button" Content="Map24" Margin="5" HorizontalAlignment="Center" Click="map24Button_Click" />
        <Button Grid.Row="1" Grid.Column="0" Name="openStreetMapButton" Content="OpenStreetMap" Margin="5" HorizontalAlignment="Center" Click="openStreetMapButton_Click" />
        <telerik:RadMap Grid.Row="2"
                    Grid.Column="0"
                    Name="radMap"
                    ZoomLevel="0"
                    Center="0,0"
                    Background="White">
        </telerik:RadMap>
    </Grid>
</Window>

All the best,
Andrey Murzov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Mapi
Top achievements
Rank 1
answered on 23 Jul 2010, 12:01 PM
Thanks, it perfectly works now!
Tags
Map
Asked by
Mapi
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Mapi
Top achievements
Rank 1
Share this question
or