source:
trunk/workshop-routing-foss4g/web/OpenLayers/lib/OpenLayers/Control/NavToolbar.js
@
76
Revision 76, 1.7 KB checked in by djay, 12 years ago (diff) | |
---|---|
|
Line | |
---|---|
1 | /* Copyright (c) 2006-2010 by OpenLayers Contributors (see authors.txt for |
2 | * full list of contributors). Published under the Clear BSD license. |
3 | * See http://svn.openlayers.org/trunk/openlayers/license.txt for the |
4 | * full text of the license. */ |
5 | |
6 | /** |
7 | * @requires OpenLayers/Control/Panel.js |
8 | * @requires OpenLayers/Control/Navigation.js |
9 | * @requires OpenLayers/Control/ZoomBox.js |
10 | */ |
11 | |
12 | /** |
13 | * Class: OpenLayers.Control.NavToolbar |
14 | * This Toolbar is an alternative to the Navigation control that displays |
15 | * the state of the control, and provides a UI for changing state to |
16 | * use the zoomBox via a Panel control. |
17 | * |
18 | * If you wish to change the properties of the Navigation control used |
19 | * in the NavToolbar, see: |
20 | * http://trac.openlayers.org/wiki/Toolbars#SubclassingNavToolbar |
21 | * |
22 | * |
23 | * Inherits from: |
24 | * - <OpenLayers.Control.Panel> |
25 | */ |
26 | OpenLayers.Control.NavToolbar = OpenLayers.Class(OpenLayers.Control.Panel, { |
27 | |
28 | /** |
29 | * Constructor: OpenLayers.Control.NavToolbar |
30 | * Add our two mousedefaults controls. |
31 | * |
32 | * Parameters: |
33 | * options - {Object} An optional object whose properties will be used |
34 | * to extend the control. |
35 | */ |
36 | initialize: function(options) { |
37 | OpenLayers.Control.Panel.prototype.initialize.apply(this, [options]); |
38 | this.addControls([ |
39 | new OpenLayers.Control.Navigation(), |
40 | new OpenLayers.Control.ZoomBox() |
41 | ]); |
42 | }, |
43 | |
44 | /** |
45 | * Method: draw |
46 | * calls the default draw, and then activates mouse defaults. |
47 | */ |
48 | draw: function() { |
49 | var div = OpenLayers.Control.Panel.prototype.draw.apply(this, arguments); |
50 | this.activateControl(this.controls[0]); |
51 | return div; |
52 | }, |
53 | |
54 | CLASS_NAME: "OpenLayers.Control.NavToolbar" |
55 | }); |
Note: See TracBrowser
for help on using the repository browser.