Display the map at an initial viewpoint representing a bounding geometry.
Use case
Setting the initial viewpoint is useful when a user wishes to first load the map at a particular area of interest.
How to use the sample
When the sample loads, note that the map view opens at the initial viewpoint defined on the map.
How it works
- Instantiate a
Map
object. - Instantiate a
Viewpoint
object using anEnvelope
object. - Set the starting location of the map with
map.InitialViewpoint
. - Set the map in the
MapView
.
Relevant API
- Envelope
- Map
- MapView
- Point
- Viewpoint
Tags
extent, envelope, initial, viewpoint, zoom
Sample Code
<UserControl
x:Class="ArcGIS.UWP.Samples.SetInitialMapArea.SetInitialMapArea"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<esriUI:MapView x:Name="MyMapView"/>
</Grid>
</UserControl>