From 2848e4dd36fa7a881705f4edb67a40b1c0f84a50 Mon Sep 17 00:00:00 2001 From: Henrik Fehlauer Date: Wed, 3 Jun 2020 18:00:00 +0000 Subject: [PATCH] Add shortcut to reverse route Press 'R' to swap start and end of the route. --- js/plugin/Routing.js | 5 ++++- locales/en.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/js/plugin/Routing.js b/js/plugin/Routing.js index e9e1b2b..3675887 100644 --- a/js/plugin/Routing.js +++ b/js/plugin/Routing.js @@ -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(); } }, diff --git a/locales/en.json b/locales/en.json index eb9c6ef..3814eeb 100644 --- a/locales/en.json +++ b/locales/en.json @@ -123,7 +123,7 @@ "opacity-slider": "Set transparency of route track and markers\n(Hold M key to mute temporarily)", "preview": "Preview", "privacy": "Privacy", - "reverse-route": "Reverse route", + "reverse-route": "Reverse route (R key)", "route-quality-altitude": "Altitude coding (C key to toggle)", "route-quality-cost": "Cost coding (C key to toggle)", "route-quality-incline": "Incline coding (C key to toggle)",