Merge pull request #221 from Phyks/exportWaypoints
Export waypoints from BRouter-web interface
This commit is contained in:
commit
4b470ab0b6
3 changed files with 35 additions and 2 deletions
26
index.html
26
index.html
|
|
@ -682,6 +682,32 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
<fieldset id="export-includes" class="form-group">
|
||||||
|
<div class="row">
|
||||||
|
<legend
|
||||||
|
class="col-form-label col-sm-2"
|
||||||
|
data-i18n="export.include"
|
||||||
|
>
|
||||||
|
Include
|
||||||
|
</legend>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<div class="form-check">
|
||||||
|
<label class="form-check-label">
|
||||||
|
<input
|
||||||
|
class="form-check-input"
|
||||||
|
id="include-waypoints"
|
||||||
|
type="checkbox"
|
||||||
|
name="include-waypoints"
|
||||||
|
/>
|
||||||
|
<span
|
||||||
|
data-i18n="export.include_waypoints"
|
||||||
|
>Waypoints</span
|
||||||
|
>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,14 @@ BR.Export = L.Class.extend({
|
||||||
exportForm['format'].value ||
|
exportForm['format'].value ||
|
||||||
$('#export-format input:radio:checked').val();
|
$('#export-format input:radio:checked').val();
|
||||||
var name = encodeURIComponent(exportForm['trackname'].value);
|
var name = encodeURIComponent(exportForm['trackname'].value);
|
||||||
|
var includeWaypoints = exportForm['include-waypoints'].checked;
|
||||||
|
|
||||||
var uri = this.router.getUrl(this.latLngs, format, name);
|
var uri = this.router.getUrl(
|
||||||
|
this.latLngs,
|
||||||
|
format,
|
||||||
|
name,
|
||||||
|
includeWaypoints
|
||||||
|
);
|
||||||
|
|
||||||
var evt = document.createEvent('MouseEvents');
|
var evt = document.createEvent('MouseEvents');
|
||||||
evt.initMouseEvent(
|
evt.initMouseEvent(
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ L.BRouter = L.Class.extend({
|
||||||
return opts;
|
return opts;
|
||||||
},
|
},
|
||||||
|
|
||||||
getUrl: function(latLngs, format, trackname) {
|
getUrl: function(latLngs, format, trackname, exportWaypoints) {
|
||||||
var urlParams = this.getUrlParams(latLngs, format);
|
var urlParams = this.getUrlParams(latLngs, format);
|
||||||
|
|
||||||
var args = [];
|
var args = [];
|
||||||
|
|
@ -137,6 +137,7 @@ L.BRouter = L.Class.extend({
|
||||||
trackname: trackname
|
trackname: trackname
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
if (exportWaypoints) args.push('exportWaypoints=1');
|
||||||
|
|
||||||
var prepend_host = format != null;
|
var prepend_host = format != null;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue