ArcGIS Runtime SDK for .NET Samples

Change viewpoint

Change viewpoint
Loading

Code

<UserControl 
    x:Class="ArcGISRuntime.WPF.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:esri="http://schemas.esri.com/arcgis/runtime/2013" 
    mc:Ignorable="d" 
    d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <esri:MapView x:Name="MyMapView">
            <esri:Map>
                <esri:ArcGISTiledLayer x:Name="Basemap"
                    Source="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>
            </esri:Map>
        </esri:MapView>
        <Border Background="White" BorderBrush="Black" BorderThickness="1"
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Margin="30" Padding="20" Width="375">
            <StackPanel>
                <TextBlock Text="Select one of the buttons to run the related Viewpoint code"
                           HorizontalAlignment="Center"
                           Margin="0,0,0,2" 
                           TextWrapping="Wrap" />
                <WrapPanel HorizontalAlignment="Center">
                    <Button Content="Geometry"
		                HorizontalAlignment="Left"
		                Margin="10,10,0,0"
                        Padding="4"    
		                VerticalAlignment="Top"
		                Width="Auto"
		                Click="OnButtonClick" 
                        ToolTip="Sets Viewpoint to a predefined Polygon's extent"/>
                    <Button Content="Center and Scale"
		                HorizontalAlignment="Center"
		                Margin="10,10,0,0"
                        Padding="4"
		                VerticalAlignment="Top"
		                Width="Auto"
		                Click="OnButtonClick"
                        ToolTip="Sets Viewpoint a predefined point and scale"/>
                    <Button Content="Animate"
		                HorizontalAlignment="Right"
		                Margin="10,10,0,0"
                        Padding="4"
		                VerticalAlignment="Top"
		                Width="Auto"
		                Click="OnButtonClick"
                        ToolTip="Sets Viewpoint and animate repositioning of view"/>
                </WrapPanel>
            </StackPanel>
        </Border>
    </Grid>
</UserControl>


In this topic
  1. Code