Allow user to specify the 'slideFactor' for the default panzoom control. (Closes #996)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@4785 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2007-10-03 16:19:04 +00:00
parent d29782e3e2
commit cb494d0c3f

View File

@@ -15,7 +15,8 @@ OpenLayers.Control.PanZoom = OpenLayers.Class(OpenLayers.Control, {
/**
* APIProperty: slideFactor
* {Integer}
* {Integer} Number of pixels by which we'll pan the map in any direction
* on clicking the arrow buttons.
*/
slideFactor: 50,
@@ -154,16 +155,16 @@ OpenLayers.Control.PanZoom = OpenLayers.Class(OpenLayers.Control, {
switch (this.action) {
case "panup":
this.map.pan(0, -50);
this.map.pan(0, -this.slideFactor);
break;
case "pandown":
this.map.pan(0, 50);
this.map.pan(0, this.slideFactor);
break;
case "panleft":
this.map.pan(-50, 0);
this.map.pan(-this.slideFactor, 0);
break;
case "panright":
this.map.pan(50, 0);
this.map.pan(this.slideFactor, 0);
break;
case "zoomin":
this.map.zoomIn();