English

FAQ: Why is the Zoom to Full Extent tool behaving differently after installing Service Pack 1?

Question

Why is the Zoom to Full Extent tool behaving differently after installing Service Pack 1?

Answer

The functionality of zooming to the full extent of all resources in a Web ADF Map Control has changed at version 9.3 Service Pack 1 (SP1).

At version 9.3 final, the map zooms to the full extent of the primary map resource. As of version 9.3 SP 1, the map zooms to the full extent of all map resources, with one exception. If the primary map resource is cached, the map is restricted to the scale levels of that resource's cache. If the minimum cache scale level cannot accommodate the full extent, the map zooms to the center of the full extent at the smallest scale available.

To avoid this behavior, make sure the primary map resource's cache has a scale level that can contain the combined full extent for all resources. Scale levels can be added to an existing cache using ArcToolbox's Manage Map Server Cache Scales tool. See the help topic Updating a map cache for further information.

To revert the full extent tool in a Web Mapping Application to the pre-SP1 behavior:

1. In Visual Studio, open the application's Default.aspx file.
2. Find the markup for Toolbar1. If the application has not been customized, the markup begins on line 71.
3. Add the attribute OnCommandClick to the markup and assign it a value of "Toolbar1_CommandClick." If this is added to the end of the first line of the Toolbar's markup, that line will appear as follows:

Code:

<esri:Toolbar ID="Toolbar1" runat="server" BuddyControlType="Map" Group="Toolbar1_Group" Height="28px" OnCommandClick="Toolbar1_CommandClick"

4. Open the Default page's code-behind file, Default.aspx.cs.
5. Inside the closing bracket of the _Default class definition, on line 204, insert the following method:

Code:

protected void Toolbar1_CommandClick(object sender, ToolbarCommandClickEventArgs toolbarCommandClickEventArgs)
{
if (toolbarCommandClickEventArgs.CommandName == "MapFullExtent")
{
Map1.CallbackResults.Clear();
Map1.Zoom(Map1.PrimaryMapResourceInstance.MapInformation.FullExtent);
}
}

6. Build the application.