source:
trunk/workshop-routing-foss4g/web/OpenLayers/lib/OpenLayers/Control/PanPanel.js
@
76
Revision 76, 2.2 KB checked in by djay, 12 years ago (diff) | |
---|---|
|
Rev | Line | |
---|---|---|
[76] | 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/Pan.js | |
9 | */ | |
10 | ||
11 | /** | |
12 | * Class: OpenLayers.Control.PanPanel | |
13 | * The PanPanel is visible control for panning the map North, South, East or | |
14 | * West in small steps. By default it is drawn in the top left corner of the | |
15 | * map. | |
16 | * | |
17 | * Note: | |
18 | * If you wish to use this class with the default images and you want | |
19 | * it to look nice in ie6, you should add the following, conditionally | |
20 | * added css stylesheet to your HTML file: | |
21 | * | |
22 | * (code) | |
23 | * <!--[if lte IE 6]> | |
24 | * <link rel="stylesheet" href="../theme/default/ie6-style.css" type="text/css" /> | |
25 | * <![endif]--> | |
26 | * (end) | |
27 | * | |
28 | * Inherits from: | |
29 | * - <OpenLayers.Control.Panel> | |
30 | */ | |
31 | OpenLayers.Control.PanPanel = OpenLayers.Class(OpenLayers.Control.Panel, { | |
32 | ||
33 | /** | |
34 | * APIProperty: slideFactor | |
35 | * {Integer} Number of pixels by which we'll pan the map in any direction | |
36 | * on clicking the arrow buttons, defaults to 50. | |
37 | */ | |
38 | slideFactor: 50, | |
39 | ||
40 | /** | |
41 | * Constructor: OpenLayers.Control.PanPanel | |
42 | * Add the four directional pan buttons. | |
43 | * | |
44 | * Parameters: | |
45 | * options - {Object} An optional object whose properties will be used | |
46 | * to extend the control. | |
47 | */ | |
48 | initialize: function(options) { | |
49 | OpenLayers.Control.Panel.prototype.initialize.apply(this, [options]); | |
50 | this.addControls([ | |
51 | new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH, | |
52 | {slideFactor: this.slideFactor}), | |
53 | new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH, | |
54 | {slideFactor: this.slideFactor}), | |
55 | new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST, | |
56 | {slideFactor: this.slideFactor}), | |
57 | new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST, | |
58 | {slideFactor: this.slideFactor}) | |
59 | ]); | |
60 | }, | |
61 | ||
62 | CLASS_NAME: "OpenLayers.Control.PanPanel" | |
63 | }); |
Note: See TracBrowser
for help on using the repository browser.