Improve Control.KeyboardDefaults. Fixes #42.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@2540 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2007-03-08 20:04:04 +00:00
parent a779f0e69a
commit be1ef0ef47

View File

@@ -28,7 +28,7 @@ OpenLayers.Control.KeyboardDefaults.prototype =
draw: function() {
OpenLayers.Event.observe(document,
'keypress',
this.defaultKeyDown.bind(this));
this.defaultKeyDown.bindAsEventListener(this));
},
/**
@@ -48,7 +48,21 @@ OpenLayers.Control.KeyboardDefaults.prototype =
case OpenLayers.Event.KEY_DOWN:
this.map.pan(0, 50);
break;
case 33: // Page Up
this.map.zoomIn();
break;
case 34: // Page Down
this.map.zoomOut();
break;
}
switch(evt.charCode) {
case 43: // +
this.map.zoomIn();
break;
case 45: // -
this.map.zoomOut();
break;
}
},
/** @final @type String */