The map handles keypress events but no panning keys

This commit is contained in:
Mihai Varga 2015-04-27 10:18:13 +03:00
parent 7fa1ae861d
commit b6671341a7
2 changed files with 3 additions and 14 deletions

View file

@ -39,8 +39,7 @@
minZoom: 1,
maxZoom: 20,
server: "ws://localhost:9980",
dragging: false,
keyboard: false
dragging: false
});
////// Document layer ////

View file

@ -85,7 +85,7 @@ L.Map.Keyboard = L.Handler.extend({
},
_setPanOffset: function (pan) {
var keys = this._panKeys = {},
var keys = {},
codes = this.keyCodes,
i, len;
@ -130,17 +130,7 @@ L.Map.Keyboard = L.Handler.extend({
var key = e.keyCode,
map = this._map;
if (key in this._panKeys) {
if (map._panAnim && map._panAnim._inProgress) { return; }
map.panBy(this._panKeys[key]);
if (map.options.maxBounds) {
map.panInsideBounds(map.options.maxBounds);
}
} else if (key in this._zoomKeys) {
if (key in this._zoomKeys) {
map.setZoom(map.getZoom() + (e.shiftKey ? 3 : 1) * this._zoomKeys[key]);
} else if (key === 27) {