Sorry folks, I'm so new to WPF/XAML and am a little lost here. I have a geomap in a grid cell but its not filling the entire thing - that is until I actually run the app and start to zoom in on the map and then presto chango it fills the entire cell. Again, I know this is easy but I am yet a young student who is in a little over his head on this summer project. This is a little snipet of the xaml file in which there is a grid definition and then a xamgeographicalmap
<Grid.RowDefinitions> <RowDefinition Height="75" /> <RowDefinition Height="*" /> <RowDefinition Height="45" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="30" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="250" /> </Grid.ColumnDefinitions> <ig:XamGeographicMap x:Name="GeoMap" Grid.Column="1" Grid.Row="1" Background="Transparent" PlotAreaBackground="Transparent" OverviewPlusDetailPaneVisibility="Collapsed" HorizontalZoomable="True" VerticalZoomable="True" BorderThickness="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" WorldRect="-180,-75,360,150"> <ig:XamGeographicMap.BackgroundContent> <ig:BingMapsMapImagery ApiKey="****************************"/> </ig:XamGeographicMap.BackgroundContent>
</ig:XamGeographicMap>
Hello Matthew,
The XamGeographicMap's WorldRect Property determines the world bounding rectangle and this is why you are not able to zoom out. Also I can say that the map always zooms vertically and horizontally, but since the Grid's Cell is rectangular it looks like the first times it zooms only horizontally.
Hope this helps you.
Oh I just noticed if I change my WorldRect to something like WorldRect="-115,32,14,20" it fills the entire grid cell to start. However then I can't zoom out further than whatever those coordinates are - which might be okay but I think I'm just missing something easy here.
Your sample appears to do the same thing as mine. Run the app and you'll notice the map is a square. But then start zooming in on the map and the size of the map changes to fill the grid and it becomes rectangular.
Thank you for your post. I have been looking into it and I created a sample project for you following your scenario and everything seems to work ok on my side. If the sample doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.
Looking forward for your reply.