Programming with JViews Maps > Creating a Map Application Using the API > Using the GUI Beans > Zoom Control Panel

The Zoom Control panel Bean is represented by the IlvJAdvancedZoomControl class. This Bean enables users to zoom in and zoom out on a map at a rate determined by the displacement of the pointer.

An example of the Zoom Control panel is shown in Figure 3.6.

zoompanel.png

Figure 3.6 Zoom Control Panel

Including the Bean in an Application

To include the Zoom Control panel in your application, write the following lines of code:

IlvJAdvancedZoomControl zoomer = new IlvJAdvancedZoomControl();
zoomer.setView(view);

Adding the Bean to a Swing Container

You can then add this Bean to a Swing container:

panel.add(zoomer, BorderLayout.WEST);

Customizing the Appearance and Behavior

This Bean can be presented in horizontal or vertical layout, using:

zoomer.setOrientation(SwingConstants.VERTICAL);

By default, this Bean zooms in or out of the view at a maximum rate of 6% every 40ms. You can change these default values to better suit your needs using, for example:

zoomer.setMaxZoomingRatio(1.1);
zoomer.setZoomDelay(100);