patch for improved mousedragging. We were able to test this on my eeepc

and get a very obvious speedup in performance. This adds a configurable
'interval' to the dragpan control (and an interval to the 'drag' control,
defaulting to 0px). Patch put together by tcoulter. (Closes #1509) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7608 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-07-30 16:27:48 +00:00
parent 7d3d615172
commit bc06972aea
3 changed files with 60 additions and 14 deletions

View File

@@ -30,6 +30,12 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
*/
dragPan: null,
/**
* APIProprety: dragPanOptions
* Options passed to the DragPan control.
*/
dragPanOptions: null,
/**
* Property: zoomBox
* {<OpenLayers.Control.ZoomBox>}
@@ -41,7 +47,7 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
* {Boolean} Whether the mousewheel should zoom the map
*/
zoomWheelEnabled: true,
/**
* Constructor: OpenLayers.Control.Navigation
* Create a new navigation control
@@ -110,7 +116,9 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
'double': true,
'stopDouble': true
});
this.dragPan = new OpenLayers.Control.DragPan({map: this.map});
this.dragPan = new OpenLayers.Control.DragPan(
OpenLayers.Util.extend({map: this.map}, this.dragPanOptions)
);
this.zoomBox = new OpenLayers.Control.ZoomBox(
{map: this.map, keyMask: OpenLayers.Handler.MOD_SHIFT});
this.dragPan.draw();