| Programming with JViews Maps > Creating a Map Application Using the API > Using the GUI Beans > Zoom Control Panel |
Zoom Control Panel |
INDEX
PREVIOUS
NEXT
|
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.
To include the Zoom Control panel in your application, write the following lines of code:
IlvJAdvancedZoomControl zoomer = new IlvJAdvancedZoomControl(); zoomer.setView(view);
You can then add this Bean to a Swing container:
panel.add(zoomer, BorderLayout.WEST);
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);
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. Legal terms. | PREVIOUS NEXT |