Zoom to Extent Map Tool

Operations Dashboard for ArcGIS with the Zoom to Extent Map Tool sample

This Operations Dashboard for ArcGIS sample demonstrates how to implement a custom map tool that allows a user to zoom to an extent that they draw on the map. It also includes a custom toolbar to allow cancelation and prevent other tools use in the meantime.

Operations Dashboard for ArcGIS samples are supported only in Visual Studio 2012. A live preview is not available.

To run this sample, open the solution in Visual Studio 2012, set the Start Action and Start Options debug options in the Project Properties as described in the Testing add-ins help topic, and then build and run the project.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ZoomExtentMapToolCS.ZoomExtentMapTool"
             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:ed="http://schemas.microsoft.com/expression/2010/drawing"
             xmlns:opsDash="clr-namespace:ESRI.ArcGIS.OperationsDashboard;assembly=ESRI.ArcGIS.OperationsDashboard"
             mc:Ignorable="d">
  <Grid>
    <Button x:Name="ZoomButton" Style="{StaticResource ToolbarButtonStyle}" ToolTip="Click on the map and drag a rectangle to zoom to." Click="Button_Click"> 
      <Image Source="/ZoomExtentMapToolCS;component/Images/ZoomBox16.png" Stretch="None" />
    </Button>
  </Grid>
</UserControl>
Sample code usage restrictions
5/16/2014