From c1169c5c6ae1df7042a2194c3eff5da07804faa9 Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Tue, 16 Jul 2019 12:07:54 +0200 Subject: [PATCH 1/2] Export waypoints from BRouter-web interface. Counterpart of https://github.com/abrensch/brouter/pull/170 --- .prettierrc | 6 +++--- css/leaflet-routing.css | 6 +++--- index.html | 22 ++++++++++++++++++++++ js/control/Export.js | 8 +++++++- js/router/BRouter.js | 8 +++++++- 5 files changed, 42 insertions(+), 8 deletions(-) diff --git a/.prettierrc b/.prettierrc index 18815a1..cd93fd9 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,4 @@ { - "singleQuote": true, - "tabWidth": 4 -} \ No newline at end of file + "singleQuote": true, + "tabWidth": 4 +} diff --git a/css/leaflet-routing.css b/css/leaflet-routing.css index 6e098e4..540c852 100644 --- a/css/leaflet-routing.css +++ b/css/leaflet-routing.css @@ -1,5 +1,5 @@ div.line-mouse-marker { - background-color: white; - border: 4px solid magenta; - border-radius: 8px; + background-color: white; + border: 4px solid magenta; + border-radius: 8px; } diff --git a/index.html b/index.html index f3841a2..c7387fa 100644 --- a/index.html +++ b/index.html @@ -680,6 +680,28 @@ + + + +
+
+ +
+
+ + +
+
- + Include
- +
diff --git a/js/control/Export.js b/js/control/Export.js index 68c2b1d..5e9e9f1 100644 --- a/js/control/Export.js +++ b/js/control/Export.js @@ -45,13 +45,13 @@ BR.Export = L.Class.extend({ exportForm['format'].value || $('#export-format input:radio:checked').val(); var name = encodeURIComponent(exportForm['trackname'].value); - var exportWaypoints = exportForm['export-waypoints'].checked; + var includeWaypoints = exportForm['include-waypoints'].checked; var uri = this.router.getUrl( this.latLngs, format, name, - exportWaypoints + includeWaypoints ); var evt = document.createEvent('MouseEvents'); diff --git a/js/router/BRouter.js b/js/router/BRouter.js index ddddc51..c3cfb2c 100644 --- a/js/router/BRouter.js +++ b/js/router/BRouter.js @@ -137,12 +137,7 @@ L.BRouter = L.Class.extend({ trackname: trackname }) ); - if (exportWaypoints) - args.push( - L.Util.template('exportWaypoints={exportWaypoints}', { - exportWaypoints: +exportWaypoints - }) - ); + if (exportWaypoints) args.push('exportWaypoints=1'); var prepend_host = format != null;