Format name and creator
This commit is contained in:
parent
da9ffd9224
commit
265583e0c5
6 changed files with 12 additions and 4 deletions
|
|
@ -286,6 +286,7 @@ gulp.task('bump:html', function () {
|
||||||
return gulp
|
return gulp
|
||||||
.src('./index.html')
|
.src('./index.html')
|
||||||
.pipe(replace(/<sup class="version">(.*)<\/sup>/, '<sup class="version">' + pkg.version + '</sup>'))
|
.pipe(replace(/<sup class="version">(.*)<\/sup>/, '<sup class="version">' + pkg.version + '</sup>'))
|
||||||
|
.pipe(replace(/BR.version = '(.*?)';/, "BR.version = '" + pkg.version + "';"))
|
||||||
.pipe(gulp.dest('.'));
|
.pipe(gulp.dest('.'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1143,6 +1143,7 @@
|
||||||
<script>
|
<script>
|
||||||
// global package prefix for BRouter web application
|
// global package prefix for BRouter web application
|
||||||
BR = {};
|
BR = {};
|
||||||
|
BR.version = '0.15.1';
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
'\r\n###\r\n### BRouter-Web\r\n###\r\n### Please note that the routing API used here is not public!\r\n###\r\n'
|
'\r\n###\r\n### BRouter-Web\r\n###\r\n### Please note that the routing API used here is not public!\r\n###\r\n'
|
||||||
|
|
|
||||||
|
|
@ -46,13 +46,14 @@ BR.Export = L.Class.extend({
|
||||||
_export: function (e) {
|
_export: function (e) {
|
||||||
var exportForm = document.forms['export'];
|
var exportForm = document.forms['export'];
|
||||||
var format = exportForm['format'].value || $('#export-format input:radio:checked').val();
|
var format = exportForm['format'].value || $('#export-format input:radio:checked').val();
|
||||||
var name = encodeURIComponent(exportForm['trackname'].value);
|
var name = exportForm['trackname'].value;
|
||||||
|
var nameUri = encodeURIComponent(name);
|
||||||
var includeWaypoints = exportForm['include-waypoints'].checked;
|
var includeWaypoints = exportForm['include-waypoints'].checked;
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
if (true) {
|
if (true) {
|
||||||
var uri = this.router.getUrl(this.latLngs, this.pois.getMarkers(), null, format, name, includeWaypoints);
|
var uri = this.router.getUrl(this.latLngs, this.pois.getMarkers(), null, format, nameUri, includeWaypoints);
|
||||||
|
|
||||||
// var evt = document.createEvent('MouseEvents');
|
// var evt = document.createEvent('MouseEvents');
|
||||||
// evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
// evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||||
|
|
@ -69,6 +70,9 @@ BR.Export = L.Class.extend({
|
||||||
|
|
||||||
_formatTrack: function (format, name, includeWaypoints) {
|
_formatTrack: function (format, name, includeWaypoints) {
|
||||||
const track = BR.Export._concatTotalTrack(this.segments);
|
const track = BR.Export._concatTotalTrack(this.segments);
|
||||||
|
if (name) {
|
||||||
|
track.features[0].properties.name = name;
|
||||||
|
}
|
||||||
this._addPois(track);
|
this._addPois(track);
|
||||||
if (includeWaypoints) {
|
if (includeWaypoints) {
|
||||||
this._addRouteWaypoints(track);
|
this._addRouteWaypoints(track);
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ BR.Gpx = {
|
||||||
const gpxTransform = new GpxTransform(voiceHintsTransform);
|
const gpxTransform = new GpxTransform(voiceHintsTransform);
|
||||||
|
|
||||||
let gpx = togpx(geoJson, {
|
let gpx = togpx(geoJson, {
|
||||||
|
creator: 'BRouter-Web ' + BR.version,
|
||||||
featureTitle: function () {},
|
featureTitle: function () {},
|
||||||
featureDescription: function () {},
|
featureDescription: function () {},
|
||||||
featureCoordTimes: function () {},
|
featureCoordTimes: function () {},
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ BR.Diff.diffPrettyHtml = function (diffs, contextLen = 2) {
|
||||||
// TODO remove
|
// TODO remove
|
||||||
// copied from Gpx.test.js
|
// copied from Gpx.test.js
|
||||||
BR.Diff.adoptGpx = function (gpx, replaceCreator = true) {
|
BR.Diff.adoptGpx = function (gpx, replaceCreator = true) {
|
||||||
const creator = 'togpx';
|
const creator = 'BRouter-Web 0.15.1';
|
||||||
const name = 'Track';
|
const name = 'Track';
|
||||||
const newline = '\n';
|
const newline = '\n';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
BR = {};
|
BR = {};
|
||||||
|
BR.version = '1.5.1';
|
||||||
turf = require('@turf/turf');
|
turf = require('@turf/turf');
|
||||||
togpx = require('togpx');
|
togpx = require('togpx');
|
||||||
require('leaflet');
|
require('leaflet');
|
||||||
|
|
@ -15,7 +16,7 @@ const path = 'tests/format/data/';
|
||||||
|
|
||||||
// resolve intended/accepted differences before comparing
|
// resolve intended/accepted differences before comparing
|
||||||
function adoptGpx(gpx, replaceCreator = true) {
|
function adoptGpx(gpx, replaceCreator = true) {
|
||||||
const creator = 'togpx';
|
const creator = 'BRouter-Web 1.5.1';
|
||||||
const name = 'Track';
|
const name = 'Track';
|
||||||
const newline = '\n';
|
const newline = '\n';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue