Default Map size fit to screen

1113
2
Jump to solution
06-14-2012 02:14 AM
SaurabhDasgupta
Deactivated User
Hi
   I have a Base Map for my Silverlight application. I want to set this map size in such a way that it should fit to any screen resolution. I have tried to changed the Height and Width to Auto and * but it doesnt work for me. Also I cant remove the nested Grid and Stackpanel as they are handling the some other controls associated with it. Can any body suggest me a solution. Using Silverlight 4 and VS2010. Please find the code

<esri:Map x:Name="edmsMap" Grid.RowSpan="2" Width="1024" Height="550" ExtentChanged="edmsMap_ExtentChanged"  IsLogoVisible="False" Margin="0,5,0,5" HorizontalAlignment="Left" VerticalAlignment="Top">
            <esri:Map.Template>
                <ControlTemplate>
                    <Grid Background="{TemplateBinding Background}">
                        <Grid x:Name="RootElement" Width="Auto" Height="Auto" />
                        <StackPanel Orientation="Vertical" HorizontalAlignment="Left"  VerticalAlignment="Bottom">
                            <esri:ScaleBar Name="edmsMapScaleBar" Map="{Binding ElementName=edmsMap}"
                                           HorizontalAlignment="Left"  VerticalAlignment="Top"
                                           MapUnit="DecimalDegrees" DisplayUnit="Kilometers"
                                           TextColor="Black" FontFamily="Courier New" FontSize="18"
                                           FillColor1="Green" FillColor2="GreenYellow" />
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </esri:Map.Template>



Many thanks.

~Saurabh.

Note: By mistake this post has been marked as answer. I am unable remove the icon for that.
0 Kudos
1 Solution

Accepted Solutions
JoeHershman
MVP Alum
Try it without any Height and Width set and without the Alignment settings

     <esri:Map x:Name="edmsMap" Grid.RowSpan="2" ExtentChanged="edmsMap_ExtentChanged" IsLogoVisible="False" Margin="0,5,0,5" > 
Thanks,
-Joe

View solution in original post

0 Kudos
2 Replies
JoeHershman
MVP Alum
Try it without any Height and Width set and without the Alignment settings

     <esri:Map x:Name="edmsMap" Grid.RowSpan="2" ExtentChanged="edmsMap_ExtentChanged" IsLogoVisible="False" Margin="0,5,0,5" > 
Thanks,
-Joe
0 Kudos
SaurabhDasgupta
Deactivated User
Thanks minerjoe for the reply. I am able to fit it across the screens.

~Saurabh.
0 Kudos