The IlvZoomTool component
is a JavaScript component that shows a set of buttons. Each button
corresponds to a zoom level; clicking the button zoom the view to
this zoom level. The button corresponding to the current zoom level
is visually different from others so that you can tell what the current
zoom level is. The component can be vertical or horizontal, and the
images of the buttons can be customized.
To add the component, add the following lines to the
page:
<script TYPE="text/javascript" src="script/IlvZoomTool.js"></script>
This line imports the script.
Note that this component uses the IlvButton
class,
so the IlvButton.js
script must be included
also.
var zoomtool = new IlvZoomTool(x+w+25, y+15, 25, h-30, 10 , view)
zoomtool.setOrientation(’Vertical’)
zoomtool.upImage = ’images/button.gif’
zoomtool.rolloverUpImage = ’images/buttonh.gif’
zoomtool.downImage = ’images/button.gif’
zoomtool.rolloverDownImage = ’images/buttonh.gif’
zoomtool.currentImage = ’images/center.gif’
zoomtool.rolloverCurrentImage = ’images/centerh.gif’
zommtool.toHTML()
The page now looks like this, with the vertical zoom
tool on the right of the main view: