Merge vector-2.4 branch back to trunk.

svn merge sandbox/vector-2.4/@2307 sandbox/vector-2.4/@HEAD trunk/openlayers/


git-svn-id: http://svn.openlayers.org/trunk/openlayers@2803 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-03-16 13:23:56 +00:00
parent 8b9d974dc2
commit 3ca974acec
159 changed files with 10193 additions and 343 deletions

View File

@@ -7,6 +7,7 @@
* @class
*
* @requires OpenLayers/Control.js
* @requires OpenLayers/Handler/Keyboard.js
*/
OpenLayers.Control.KeyboardDefaults = OpenLayers.Class.create();
OpenLayers.Control.KeyboardDefaults.prototype =
@@ -26,16 +27,16 @@ OpenLayers.Control.KeyboardDefaults.prototype =
*
*/
draw: function() {
OpenLayers.Event.observe(document,
'keypress',
this.defaultKeyDown.bindAsEventListener(this));
this.handler = new OpenLayers.Handler.Keyboard( this, {
"keypress": this.defaultKeyPress });
this.activate();
},
/**
* @param {Event} evt
* @param {Integer} code
*/
defaultKeyDown: function (evt) {
switch(evt.keyCode) {
defaultKeyPress: function (code) {
switch(code) {
case OpenLayers.Event.KEY_LEFT:
this.map.pan(-50, 0);
break;
@@ -49,17 +50,11 @@ OpenLayers.Control.KeyboardDefaults.prototype =
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: // -
case 34: // Page Down
this.map.zoomOut();
break;
}