]> dev.renevier.net Git - syp.git/blob - openlayers/lib/OpenLayers/Control/NavToolbar.js
fixes notices
[syp.git] / openlayers / lib / OpenLayers / Control / NavToolbar.js
1 /* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
2  * license.  See http://svn.openlayers.org/trunk/openlayers/license.txt for the
3  * full text of the license. */
4
5 /**
6  * @requires OpenLayers/Control/Panel.js
7  * @requires OpenLayers/Control/Navigation.js
8  * @requires OpenLayers/Control/ZoomBox.js
9  */
10
11 /**
12  * Class: OpenLayers.Control.NavToolbar
13  * This Toolbar is an alternative to the Navigation control that displays
14  *     the state of the control, and provides a UI for changing state to
15  *     use the zoomBox via a Panel control.
16  *
17  * If you wish to change the properties of the Navigation control used
18  *     in the NavToolbar, see: 
19  *     http://trac.openlayers.org/wiki/Toolbars#SubclassingNavToolbar 
20  * 
21  * 
22  * Inherits from:
23  *  - <OpenLayers.Control.Panel>
24  */
25 OpenLayers.Control.NavToolbar = OpenLayers.Class(OpenLayers.Control.Panel, {
26
27     /**
28      * Constructor: OpenLayers.Control.NavToolbar 
29      * Add our two mousedefaults controls.
30      *
31      * Parameters:
32      * options - {Object} An optional object whose properties will be used
33      *     to extend the control.
34      */
35     initialize: function(options) {
36         OpenLayers.Control.Panel.prototype.initialize.apply(this, [options]);
37         this.addControls([
38           new OpenLayers.Control.Navigation(),
39           new OpenLayers.Control.ZoomBox()
40         ]);
41     },
42
43     /**
44      * Method: draw 
45      * calls the default draw, and then activates mouse defaults.
46      */
47     draw: function() {
48         var div = OpenLayers.Control.Panel.prototype.draw.apply(this, arguments);
49         this.activateControl(this.controls[0]);
50         return div;
51     },
52
53     CLASS_NAME: "OpenLayers.Control.NavToolbar"
54 });