added a slideFactor property in the PanPanel control patches from elemoine and me, r=bartvde (closes #2320)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9945 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
pgiraud
2010-01-13 08:40:41 +00:00
parent 311f47da78
commit cca8894b91
2 changed files with 16 additions and 4 deletions

View File

@@ -25,6 +25,13 @@
*/ */
OpenLayers.Control.PanPanel = OpenLayers.Class(OpenLayers.Control.Panel, { OpenLayers.Control.PanPanel = OpenLayers.Class(OpenLayers.Control.Panel, {
/**
* APIProperty: slideFactor
* {Integer} Number of pixels by which we'll pan the map in any direction
* on clicking the arrow buttons, defaults to 50.
*/
slideFactor: 50,
/** /**
* Constructor: OpenLayers.Control.PanPanel * Constructor: OpenLayers.Control.PanPanel
* Add the four directional pan buttons. * Add the four directional pan buttons.
@@ -36,10 +43,14 @@ OpenLayers.Control.PanPanel = OpenLayers.Class(OpenLayers.Control.Panel, {
initialize: function(options) { initialize: function(options) {
OpenLayers.Control.Panel.prototype.initialize.apply(this, [options]); OpenLayers.Control.Panel.prototype.initialize.apply(this, [options]);
this.addControls([ this.addControls([
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH), new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH,
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH), {slideFactor: this.slideFactor}),
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST), new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH,
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST) {slideFactor: this.slideFactor}),
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST,
{slideFactor: this.slideFactor}),
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST,
{slideFactor: this.slideFactor})
]); ]);
}, },

View File

@@ -36,6 +36,7 @@
<li>Control/Snapping.html</li> <li>Control/Snapping.html</li>
<li>Control/Split.html</li> <li>Control/Split.html</li>
<li>Control/WMSGetFeatureInfo.html</li> <li>Control/WMSGetFeatureInfo.html</li>
<li>Control/PanPanel.html</li>
<li>Events.html</li> <li>Events.html</li>
<li>Extras.html</li> <li>Extras.html</li>
<li>Feature.html</li> <li>Feature.html</li>