Add shortcut to reverse route

Press 'R' to swap start and end of the route.
This commit is contained in:
Henrik Fehlauer 2020-06-03 18:00:00 +00:00
parent 37ab05310b
commit 2848e4dd36
2 changed files with 5 additions and 2 deletions

View file

@ -28,7 +28,8 @@ BR.Routing = L.Routing.extend({
draw: {
enable: 68, // char code for 'd'
disable: 27 // char code for 'ESC'
}
},
reverse: 82 // char code for 'r'
}
},
@ -349,6 +350,8 @@ BR.Routing = L.Routing.extend({
this._draw.disable();
} else if (e.keyCode === this.options.shortcut.draw.enable) {
this._draw.enable();
} else if (e.keyCode === this.options.shortcut.reverse) {
this.reverse();
}
},