From cb494d0c3f63024bf45480d0c8ebf4e280cf29c0 Mon Sep 17 00:00:00 2001 From: euzuro Date: Wed, 3 Oct 2007 16:19:04 +0000 Subject: [PATCH] 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 --- lib/OpenLayers/Control/PanZoom.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/OpenLayers/Control/PanZoom.js b/lib/OpenLayers/Control/PanZoom.js index dae4734022..65c906445e 100644 --- a/lib/OpenLayers/Control/PanZoom.js +++ b/lib/OpenLayers/Control/PanZoom.js @@ -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();