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. */
6
* @requires OpenLayers/Control.js
10
* Class: OpenLayers.Control.Pan
13
* - <OpenLayers.Control>
15
OpenLayers.Control.Pan = OpenLayers.Class(OpenLayers.Control, {
18
* APIProperty: slideFactor
19
* {Integer} Number of pixels by which we'll pan the map in any direction
20
* on clicking the arrow buttons.
26
* {String} in {'North', 'South', 'East', 'West'}
32
* {String} The type of <OpenLayers.Control> -- When added to a
33
* <Control.Panel>, 'type' is used by the panel to determine how to
36
type: OpenLayers.Control.TYPE_BUTTON,
39
* Constructor: OpenLayers.Control.Pan
40
* Control which handles the panning (in any of the cardinal directions)
41
* of the map by a set px distance.
44
* direction - {String} The direction this button should pan.
45
* options - {Object} An optional object whose properties will be used
46
* to extend the control.
48
initialize: function(direction, options) {
50
this.direction = direction;
51
this.CLASS_NAME += this.direction;
53
OpenLayers.Control.prototype.initialize.apply(this, [options]);
61
switch (this.direction) {
62
case OpenLayers.Control.Pan.NORTH:
63
this.map.pan(0, -this.slideFactor);
65
case OpenLayers.Control.Pan.SOUTH:
66
this.map.pan(0, this.slideFactor);
68
case OpenLayers.Control.Pan.WEST:
69
this.map.pan(-this.slideFactor, 0);
71
case OpenLayers.Control.Pan.EAST:
72
this.map.pan(this.slideFactor, 0);
77
CLASS_NAME: "OpenLayers.Control.Pan"
80
OpenLayers.Control.Pan.NORTH = "North";
81
OpenLayers.Control.Pan.SOUTH = "South";
82
OpenLayers.Control.Pan.EAST = "East";
83
OpenLayers.Control.Pan.WEST = "West";
b'\\ No newline at end of file'