diff --git a/index.html b/index.html
index c596339..776452f 100644
--- a/index.html
+++ b/index.html
@@ -81,8 +81,10 @@
data-i18n-options='{
"tracksAction": "$t(navbar.load.tracks)",
"tracksKey": "O",
+ "trackAsRouteAction": "$t(trackasroute.title)",
+ "trackAsRouteKey": "$t(keyboard.shift)+O",
"nogosAction": "$t(navbar.load.nogos)",
- "nogosKey": "$t(keyboard.shift)+O"
+ "nogosKey": "$t(keyboard.shift)+N"
}'
title="Load route"
>
diff --git a/js/plugin/NogoAreas.js b/js/plugin/NogoAreas.js
index db50761..af3dac1 100644
--- a/js/plugin/NogoAreas.js
+++ b/js/plugin/NogoAreas.js
@@ -5,6 +5,7 @@ BR.NogoAreas = L.Control.extend({
enable: 78, // char code for 'n'
disable: 27, // char code for 'ESC'
},
+ import: 78, // char code for 'n'; used in conjunction with 'shift'
},
},
@@ -147,6 +148,13 @@ BR.NogoAreas = L.Control.extend({
if (!BR.Util.keyboardShortcutsAllowed(e)) {
return;
}
+
+ if (true === e.shiftKey && e.keyCode === this.options.shortcut.import) {
+ $('#loadNogos').modal('show');
+
+ return;
+ }
+
if (e.keyCode === this.options.shortcut.draw.disable && this.button.state() === BR.NogoAreas.STATE_CANCEL) {
this.stopDrawing(this.button);
} else if (
diff --git a/js/plugin/RouteLoaderConverter.js b/js/plugin/RouteLoaderConverter.js
index 000e93d..d719853 100644
--- a/js/plugin/RouteLoaderConverter.js
+++ b/js/plugin/RouteLoaderConverter.js
@@ -15,6 +15,9 @@ BR.routeLoader = function (map, layersControl, routing, pois) {
simplifyTolerance: -1,
isTestMode: false,
simplifyLastKnownGood: 0.001,
+ shortcut: {
+ open: 79, // char code for 'O'; used in conjunction with 'shift'
+ },
},
setDialogDraggable: function (jqDlgHeader) {
@@ -84,12 +87,14 @@ BR.routeLoader = function (map, layersControl, routing, pois) {
(this._bounds = undefined), (this._trackPoints = []);
this._currentGeoJSON = {};
this._options = {
- ext: 'gpx',
showTrackLayer: true,
showPointAsPoi: true,
simplifyTolerance: -1,
isTestMode: false,
simplifyLastKnownGood: 0.001,
+ shortcut: {
+ open: 79, // char code for 'O'; used in conjunction with 'shift'
+ },
};
},
@@ -224,6 +229,8 @@ BR.routeLoader = function (map, layersControl, routing, pois) {
}.bind(this)
);
+ L.DomEvent.addListener(document, 'keydown', this.keydownListener, this);
+
// dummy, no own representation, delegating to EasyButton
var dummy = L.DomUtil.create('div');
dummy.hidden = true;
@@ -382,6 +389,16 @@ BR.routeLoader = function (map, layersControl, routing, pois) {
this.onBusyChanged(false);
},
+
+ keydownListener: function (e) {
+ if (
+ BR.Util.keyboardShortcutsAllowed(e) &&
+ e.keyCode === this._options.shortcut.open &&
+ true === e.shiftKey
+ ) {
+ $('#navbarLoadEditTracks').click();
+ }
+ },
});
RouteLoader.include(L.Evented.prototype);
diff --git a/js/plugin/TracksLoader.js b/js/plugin/TracksLoader.js
index 9f53401..f2c437a 100644
--- a/js/plugin/TracksLoader.js
+++ b/js/plugin/TracksLoader.js
@@ -61,12 +61,12 @@ BR.tracksLoader = function (map, layersControl, routing, pois) {
},
_keydownListener: function (e) {
- if (BR.Util.keyboardShortcutsAllowed(e) && e.keyCode === this.options.shortcut.open) {
- if (e.shiftKey) {
- $('#loadNogos').modal('show');
- } else {
- $('#navbarLoadTracks')[0].click();
- }
+ if (
+ BR.Util.keyboardShortcutsAllowed(e) &&
+ e.keyCode === this.options.shortcut.open &&
+ false === e.shiftKey
+ ) {
+ $('#navbarLoadTracks')[0].click();
}
},
});
diff --git a/locales/en.json b/locales/en.json
index 685703b..5a0ec02 100644
--- a/locales/en.json
+++ b/locales/en.json
@@ -174,8 +174,9 @@
"load": {
"nogos": "Load no-go areas",
"title": "Load",
- "tooltip": "{{tracksAction}} ({{tracksKey}} key)\n{{nogosAction}} ({{nogosKey}})",
- "tracks": "Load tracks"
+ "tooltip": "{{tracksAction}} ({{tracksKey}} key)\n{{trackAsRouteAction}} ({{trackAsRouteKey}})\n{{nogosAction}} ({{nogosKey}})",
+ "tracks": "Load tracks",
+ "trackAsRoute": "Load Track as Route"
},
"profile": {
"car-eco": "Car (economic)",