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