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:
@@ -28,7 +28,7 @@ OpenLayers.Control.KeyboardDefaults.prototype =
|
|||||||
draw: function() {
|
draw: function() {
|
||||||
OpenLayers.Event.observe(document,
|
OpenLayers.Event.observe(document,
|
||||||
'keypress',
|
'keypress',
|
||||||
this.defaultKeyDown.bind(this));
|
this.defaultKeyDown.bindAsEventListener(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -48,6 +48,20 @@ OpenLayers.Control.KeyboardDefaults.prototype =
|
|||||||
case OpenLayers.Event.KEY_DOWN:
|
case OpenLayers.Event.KEY_DOWN:
|
||||||
this.map.pan(0, 50);
|
this.map.pan(0, 50);
|
||||||
break;
|
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;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user