Export waypoints from BRouter-web interface. Counterpart of https://github.com/abrensch/brouter/pull/170
This commit is contained in:
parent
ea9cc49dd4
commit
c1169c5c6a
5 changed files with 42 additions and 8 deletions
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"singleQuote": true,
|
||||
"tabWidth": 4
|
||||
"singleQuote": true,
|
||||
"tabWidth": 4
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
22
index.html
22
index.html
|
|
@ -680,6 +680,28 @@
|
|||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<legend
|
||||
class="col-form-label col-sm-2"
|
||||
data-i18n="export.exportWaypoints"
|
||||
>
|
||||
<label
|
||||
class="form-check-label"
|
||||
for="export-waypoints"
|
||||
>
|
||||
Include waypoints
|
||||
</label>
|
||||
</legend>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-check">
|
||||
<input
|
||||
class="form-check-input"
|
||||
id="export-waypoints"
|
||||
type="checkbox"
|
||||
name="export-waypoints"
|
||||
value="1"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="modal-footer">
|
||||
|
|
|
|||
|
|
@ -45,8 +45,14 @@ 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 uri = this.router.getUrl(this.latLngs, format, name);
|
||||
var uri = this.router.getUrl(
|
||||
this.latLngs,
|
||||
format,
|
||||
name,
|
||||
exportWaypoints
|
||||
);
|
||||
|
||||
var evt = document.createEvent('MouseEvents');
|
||||
evt.initMouseEvent(
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ L.BRouter = L.Class.extend({
|
|||
return opts;
|
||||
},
|
||||
|
||||
getUrl: function(latLngs, format, trackname) {
|
||||
getUrl: function(latLngs, format, trackname, exportWaypoints) {
|
||||
var urlParams = this.getUrlParams(latLngs, format);
|
||||
|
||||
var args = [];
|
||||
|
|
@ -137,6 +137,12 @@ L.BRouter = L.Class.extend({
|
|||
trackname: trackname
|
||||
})
|
||||
);
|
||||
if (exportWaypoints)
|
||||
args.push(
|
||||
L.Util.template('exportWaypoints={exportWaypoints}', {
|
||||
exportWaypoints: +exportWaypoints
|
||||
})
|
||||
);
|
||||
|
||||
var prepend_host = format != null;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue