GEOG 485

Project 2:  Adding a Zoom Menu for Your Boss

Brian Buchanan

August 5, 2008

Project 2 was concerned with customizing ArcMap to add a zoom menu command with pre-defined zoom levels to satisfy my boss.  Specifically, I created a zoom toolbar that allowed the user (my boss) to zoom into the map at 125%, 200%, and 400%.  The toolbar also allowed the user to zoom out at 125%, 200%, and 400%.  The toolbar is shown below on a map of the United States in Figure 1.

In order to create this toolbar, I needed to create a customized toolbar and program it using both OMDs and Developer Help to determine the code that would allow the toolbar to function correctly.  I used the Customize dialog box to create the toolbar that I labeled My Zoom.  I added user interface control buttons to the toolbar under the heading Pre-defined Zoom that would correspond to the pre-defined zoom functions. 

Figure 1:  Data view showing my zoom toolbar and the six pre-defined zoom control buttons.  This image was created using ArcView 9.2 on August 4, 2008.

The next step was to create the code that corresponds to the zoom control buttons.  Examples of the code are shown below in Figure 2.  The first lines declare an interface with the MxDocument and the current document (ThisDocument).  Next, the code declares an interface with the active view and the current document active view.  Then the code declares and interacts with the Envelope object.  The next lines of code used the Expand code to change the size of the Envelope, according to the project instructions (Penn State 2008). 

Figure 2:  Example of code in Visual Basic Editor for the pre-defined zoom toolbar.  This figure was produce

In addition to creating the zoom toolbar, Project 2 contained two different exercises that were designed to assist me learning the techniques needed to complete the project.  Exercise 1 was designed to collapse the list of layers within the Table of Contents.  The code employed for Exercise 1 is shown on the top of Figure 3.  Exercise 2 reported the number of fields within the second layer and is shown at the bottom of Figure 3.  The results of the to programmed exercies is shown on Figure 4.   

Figure 3:  Code for Exercise 1 (on top of editor) and Exercise 2 (on bottom of editor).  The image was created using ArcView 9.2 on August 5, 2008.

Figure 4:  Map showing the running of Exercise 1 and Exercise 2.  This map was created using ArcView 9.2 on August 5, 2008.

Lesson 2, like Lesson 1, was difficult for me.  I am still having difficulty determining which lines of code to use where.  I did grasp the OMD and Developer Help concepts, but will need more practice before I will be able to effectively use them.  I do enjoy being able to customize and create toolbars, this is something that I wished I knew how to do during GEOG 484 on a few projects.  Overall, Lesson 2 was a good learning experience, and I hope to building upon the first two lessons for Lesson 3.

References Cited
Penn State University
2008  Lesson 2  GEOG 484 GIS Programming.  Pennsylvania State University Online.