Change viewpoint

This sample demonstrates different ways in which you can change the viewpoint or visible area of the map.

Change viewpoint

Instructions

Click any of the available buttons to change the current viewpoint

Code

<UserControl 
    x:Class="ArcGISRuntime.UWP.Samples.ChangeViewpoint.ChangeViewpoint"
    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"/>
        <Border
                Background="White" BorderBrush="Black" BorderThickness="1"
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Margin="30" Padding="20" Width="Auto">
            <StackPanel>
                <TextBlock Text="Select one of the button to runt the related Viewpoint code" 
                           Margin="0,0,0,2" TextWrapping="Wrap" />
                <RelativePanel HorizontalAlignment="Center">
                    <Button x:Name="GeomButton"
                        Content="Geometry"
                        Margin="10,10,0,0"
                        Width="Auto"
                        Click="OnButtonClick" />
                    <Button x:Name="ScaleButton"
                        Content="Center and Scale"
                        Margin="10,10,0,0"
                        Width="Auto"
                        Click="OnButtonClick"
                        RelativePanel.RightOf="GeomButton"/>
                    <Button x:Name="AnimateButton"
                        Content="Animate"
                        Margin="10,10,0,0"
                        Width="Auto"
                        Click="OnButtonClick"
                        RelativePanel.RightOf="ScaleButton"/>
                </RelativePanel>
            </StackPanel>
        </Border>
    </Grid>
</UserControl>


In this topic
  1. Instructions
  2. Code