register key listener on document instead of map container (needs focus)

This commit is contained in:
Norbert Renner 2015-05-30 15:36:38 +02:00
parent 7098cd2cf3
commit a078bc24f0

View file

@ -107,6 +107,10 @@ BR.Routing = L.Routing.extend({
}
}, this._draw);
// keys not working when map container does not have focus, use document instead
L.DomEvent.removeListener(this._container, 'keyup', this._keyupListener);
L.DomEvent.addListener(document, 'keyup', this._keyupListener, this);
// enable drawing mode
this.draw(true);