Merge pull request #354 from bagage/fix/compat-opera

Update dev deps, fix compat issue
This commit is contained in:
Norbert Renner 2020-12-05 16:18:37 +01:00 committed by GitHub
commit 87c571d976
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 3423 additions and 3429 deletions

View file

@ -2,3 +2,6 @@ language: node_js
node_js:
- lts/*
cache: yarn
script:
- yarn test
- yarn lint

View file

@ -54,7 +54,7 @@
'vm-forum-velomobil-schnell',
'fastbike-lowtraffic',
'fastbike-asia-pacific',
'hiking-beta'
'hiking-beta',
];
// Removes default base layers when 'true'. Useful for only having custom layers (see below).
@ -84,22 +84,22 @@
weight: 5,
dashArray: [10, 10],
opacity: 0.6,
color: 'magenta'
color: 'magenta',
},
track: {
weight: 5,
color: 'magenta',
opacity: BR.conf.defaultOpacity
opacity: BR.conf.defaultOpacity,
},
trackCasing: {
weight: 8,
color: 'white',
// assumed to be same as track, see setOpacity
opacity: BR.conf.defaultOpacity
opacity: BR.conf.defaultOpacity,
},
nodata: {
color: 'darkred'
}
color: 'darkred',
},
};
BR.conf.markerColors = {
@ -107,7 +107,7 @@
poi: '#436978',
start: '#72b026',
via: '#38aadd',
stop: '#d63e2a'
stop: '#d63e2a',
};
// transit (intermodal routing) demo config
@ -121,7 +121,7 @@
'fastbike',
'shortest',
'moped',
'car-test'
'car-test',
];
}

View file

@ -34,16 +34,15 @@ var debug = false;
var paths = {
// see overrides in package.json
scriptsConfig: mainNpmFiles().filter(f => RegExp('url-search-params/.*\\.js', 'i').test(f)),
scriptsConfig: mainNpmFiles().filter((f) => RegExp('url-search-params/.*\\.js', 'i').test(f)),
scripts: [
'node_modules/jquery/dist/jquery.js',
'node_modules/tether/dist/js/tether.js',
'node_modules/async/lib/async.js',
'node_modules/leaflet/dist/leaflet-src.js'
'node_modules/leaflet/dist/leaflet-src.js',
]
.concat(
mainNpmFiles().filter(
f =>
(f) =>
RegExp('.*\\.js', 'i').test(f) &&
!RegExp('.*\\.min\\.js', 'i').test(f) &&
!RegExp('url-search-params/.*\\.js', 'i').test(f)
@ -58,13 +57,13 @@ var paths = {
'js/util/*.js',
'js/plugin/*.js',
'js/control/*.js',
'js/index.js'
'js/index.js',
]),
styles: mainNpmFiles()
.filter(f => RegExp('.*\\.css', 'i').test(f) && !RegExp('.*\\.min\\.css', 'i').test(f))
.filter((f) => RegExp('.*\\.css', 'i').test(f) && !RegExp('.*\\.min\\.css', 'i').test(f))
.concat('css/*.css'),
images: mainNpmFiles().filter(f => RegExp('.*.+(png|gif|svg)', 'i').test(f)),
fonts: mainNpmFiles().filter(f => RegExp('font-awesome/fonts/.*', 'i').test(f)),
images: mainNpmFiles().filter((f) => RegExp('.*.+(png|gif|svg)', 'i').test(f)),
fonts: mainNpmFiles().filter((f) => RegExp('font-awesome/fonts/.*', 'i').test(f)),
locales: 'locales/*.json',
layers: 'layers/**/*.geojson',
layersDestName: 'layers.js',
@ -72,12 +71,12 @@ var paths = {
'layers/config/config.js',
'layers/config/tree.js',
'layers/config/overrides.js',
'layers/config/geometry.js'
'layers/config/geometry.js',
],
layersConfigDestName: 'layersConf.js',
zip: ['dist/**', 'index.html', 'config.template.js', 'keys.template.js'],
dest: 'dist',
destName: 'brouter-web'
destName: 'brouter-web',
};
gulp.task('clean', function (cb) {
@ -129,13 +128,13 @@ gulp.task('styles', function() {
}
return distUrl;
}
},
})
)
.pipe(concat(paths.destName + '.css'))
.pipe(
cleanCSS({
rebase: false
rebase: false,
})
)
.pipe(postcss([autoprefixer({ remove: false })]))
@ -171,13 +170,7 @@ gulp.task('watch', function() {
gulp.watch(paths.locales, gulp.series('locales', 'reload'));
gulp.watch(paths.styles, gulp.series('styles', 'reload'));
gulp.watch(paths.layersConfig, gulp.series('layers_config', 'reload'));
gulp.watch(
['./index.html']
.concat(paths.images)
.concat(paths.fonts)
.concat(paths.locales),
gulp.series('reload')
);
gulp.watch(['./index.html'].concat(paths.images).concat(paths.fonts).concat(paths.locales), gulp.series('reload'));
});
// Print paths to console, for manually debugging the gulp build
@ -187,10 +180,7 @@ gulp.task('log', function() {
// var src = paths.styles
// var src = paths.images
// var src = paths.locales
var src = paths.scripts
.concat(paths.styles)
.concat(paths.images)
.concat(paths.locales);
var src = paths.scripts.concat(paths.styles).concat(paths.images).concat(paths.locales);
return gulp.src(src).pipe(gulpDebug());
});
@ -199,7 +189,7 @@ gulp.task('inject', function() {
var target = gulp.src('index.html');
var sources = gulp.src(paths.scripts.concat(paths.styles), {
base: '.',
read: false
read: false,
});
return target.pipe(inject(sources, { relative: true })).pipe(gulp.dest('.'));
@ -280,18 +270,15 @@ gulp.task('i18next', function() {
loadPath: 'locales/{{lng}}.json',
// the destination path is relative to your `gulp.dest()` path
savePath: 'locales/{{lng}}.json'
}
savePath: 'locales/{{lng}}.json',
},
})
)
.pipe(gulp.dest('.'));
});
gulp.task('layers_config', function () {
return gulp
.src(paths.layersConfig)
.pipe(concat(paths.layersConfigDestName))
.pipe(gulp.dest(paths.dest));
return gulp.src(paths.layersConfig).pipe(concat(paths.layersConfigDestName)).pipe(gulp.dest(paths.dest));
});
// Bundles layer files. To download and extract run "yarn layers"
@ -332,9 +319,9 @@ gulp.task(
gulp.series('debug', function (cb) {
server.init({
server: {
baseDir: './'
baseDir: './',
},
open: false
open: false,
});
cb();
})
@ -344,7 +331,7 @@ gulp.task('release:zip', function() {
gutil.log(gutil.colors.green('Build brouter-web.' + nextVersion + '.zip'));
return gulp
.src(paths.zip, {
base: '.'
base: '.',
})
.pipe(zip('brouter-web.' + nextVersion + '.zip'))
.pipe(gulp.dest('.'));
@ -358,7 +345,7 @@ gulp.task('release:zip_standalone', function() {
var brouterWeb = gulp
.src(paths.zip, {
base: '.'
base: '.',
})
.pipe(
rename(function (path) {
@ -372,10 +359,10 @@ gulp.task('release:zip_standalone', function() {
.src(
[
'misc/readmes/profile_developers_guide.txt',
'brouter-server/target/brouter-server-*-jar-with-dependencies.jar'
'brouter-server/target/brouter-server-*-jar-with-dependencies.jar',
],
{
cwd: path.join(process.cwd(), '../brouter')
cwd: path.join(process.cwd(), '../brouter'),
}
)
.pipe(
@ -392,22 +379,20 @@ gulp.task('release:zip_standalone', function() {
'!profiles2/all.brf',
'!profiles2/car-eco-suspect_scan.brf',
'!profiles2/car-traffic_analysis.brf',
'!profiles2/softaccess.brf'
'!profiles2/softaccess.brf',
],
{
cwd: path.join(process.cwd(), '../brouter/misc/'),
base: '../brouter/misc/'
base: '../brouter/misc/',
}
);
var serverScripts = gulp.src(['standalone/**'], {
cwd: path.join(process.cwd(), '../brouter/misc/scripts/'),
base: '../brouter/misc/scripts/'
base: '../brouter/misc/scripts/',
});
return merge(brouterWeb, root, serverRoot, serverProfiles, serverScripts)
.pipe(zip(destName))
.pipe(gulp.dest('.'));
return merge(brouterWeb, root, serverRoot, serverProfiles, serverScripts).pipe(zip(destName)).pipe(gulp.dest('.'));
});
gulp.task('release:publish', function () {
@ -415,7 +400,7 @@ gulp.task('release:publish', function() {
release({
tag: nextVersion,
token: ghToken,
manifest: pkg
manifest: pkg,
})
);
});

View file

@ -41,9 +41,7 @@
data-icon="fa-random"
id="alternative"
>
<option data-i18n="navbar.alternative.original" value="0" selected
>Original
</option>
<option data-i18n="navbar.alternative.original" value="0" selected>Original</option>
<option data-i18n="navbar.alternative.first" value="1">1st alternative</option>
<option data-i18n="navbar.alternative.second" value="2">2nd alternative</option>
<option data-i18n="navbar.alternative.third" value="3">3rd alternative</option>
@ -194,9 +192,7 @@
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" data-i18n="layers.customize">
Customize layers
</h4>
<h4 class="modal-title" data-i18n="layers.customize">Customize layers</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
@ -263,9 +259,7 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" data-i18n="about.title">
About
</h4>
<h4 class="modal-title" data-i18n="about.title">About</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
@ -358,20 +352,16 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" data-i18n="loadNogos.title">
Load no-go areas
</h4>
<h4 class="modal-title" data-i18n="loadNogos.title">Load no-go areas</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p id="nogoError" class="invalid-feedback" style="display: none;"></p>
<p id="nogoError" class="invalid-feedback" style="display: none"></p>
<form>
<fieldset>
<legend data-i18n="loadNogos.source">
Source
</legend>
<legend data-i18n="loadNogos.source">Source</legend>
<p>
<input type="text" id="nogoJSON" hidden />
<label for="nogoURL" data-i18n="loadNogos.url">URL: </label>
@ -382,9 +372,7 @@
</p>
</fieldset>
<fieldset>
<legend data-i18n="loadNogos.defaultProperties">
Default properties
</legend>
<legend data-i18n="loadNogos.defaultProperties">Default properties</legend>
<p>
<label for="nogoWeight" data-i18n="loadNogos.nogoWeight"
>No-go weight (-1 means impassable):
@ -441,9 +429,7 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" data-i18n="export.title">
Export route
</h4>
<h4 class="modal-title" data-i18n="export.title">Export route</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
@ -459,9 +445,7 @@
</div>
<fieldset id="export-format" class="form-group">
<div class="row">
<legend class="col-form-label col-sm-2" data-i18n="export.format">
Format
</legend>
<legend class="col-form-label col-sm-2" data-i18n="export.format">Format</legend>
<div class="col-sm-10">
<div class="form-check">
<label class="form-check-label">
@ -517,9 +501,7 @@
</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>
<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">
@ -571,9 +553,7 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" data-i18n="trackasroute.title">
Load Track as Route
</h4>
<h4 class="modal-title" data-i18n="trackasroute.title">Load Track as Route</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
@ -596,7 +576,7 @@
<label
for="loadedittrackFile"
class="custom-file-label"
style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"
style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis"
>
</label
><br />
@ -1020,9 +1000,7 @@
<div id="stats-container" class="flexrow flexgrow">
<ul id="stats">
<li>
<div class="text-muted small d-none d-md-block" data-i18n="footer.distance">
Distance
</div>
<div class="text-muted small d-none d-md-block" data-i18n="footer.distance">Distance</div>
<p class="stats-label">
<span id="distance">-</span>&#8239;<abbr
data-i18n="[title]footer.kilometer;footer.kilometer-abbrev"
@ -1032,9 +1010,7 @@
</p>
</li>
<li>
<div class="text-muted small d-none d-md-block" data-i18n="footer.travel-time">
Travel time
</div>
<div class="text-muted small d-none d-md-block" data-i18n="footer.travel-time">Travel time</div>
<p class="stats-label">
<span id="totaltime">-</span>&#8239;<abbr
data-i18n="[title]footer.hours;footer.hours-abbrev"

View file

@ -21,6 +21,6 @@
BR.Browser = {
touchScreen: touchScreen,
touchScreenDetectable: touchScreenDetectable,
touch: touch
touch: touch,
};
})();

View file

@ -29,7 +29,7 @@ BR.LayersConfig = L.Class.extend({
if (BR.Util.localStorageAvailable()) {
var defaultLayers = {
baseLayers: baseLayers,
overlays: overlays
overlays: overlays,
};
localStorage.setItem('map/defaultLayers', JSON.stringify(defaultLayers));
}
@ -45,9 +45,9 @@ BR.LayersConfig = L.Class.extend({
properties: {
id: id,
name: id.replace('.', ' '),
dataSource: 'leaflet-providers'
dataSource: 'leaflet-providers',
},
type: 'Feature'
type: 'Feature',
};
BR.layerIndex[id] = obj;
}
@ -162,7 +162,7 @@ BR.LayersConfig = L.Class.extend({
name = found[1];
result = {
name: name,
urlVar: prefix + name
urlVar: prefix + name,
};
}
@ -218,7 +218,7 @@ BR.LayersConfig = L.Class.extend({
var options = {
maxZoom: this._map.getMaxZoom(),
bounds: layerData.geometry && !props.worldTiles ? L.geoJson(layerData.geometry).getBounds() : null
bounds: layerData.geometry && !props.worldTiles ? L.geoJson(layerData.geometry).getBounds() : null,
};
if (props.mapUrl) {
options.mapLink =
@ -237,7 +237,7 @@ BR.LayersConfig = L.Class.extend({
layer = L.tileLayer.provider(props.id);
var layerOptions = L.Util.extend(options, {
maxNativeZoom: layer.options.maxZoom
maxNativeZoom: layer.options.maxZoom,
});
L.setOptions(layer, layerOptions);
} else if (props.dataSource === 'LayersCollection') {
@ -245,7 +245,7 @@ BR.LayersConfig = L.Class.extend({
url,
L.Util.extend(options, {
minZoom: props.minZoom || 0,
maxNativeZoom: props.maxZoom
maxNativeZoom: props.maxZoom,
})
);
if (props.subdomains) {
@ -260,7 +260,7 @@ BR.LayersConfig = L.Class.extend({
minZoom: props.min_zoom || 0,
maxNativeZoom: props.max_zoom,
subdomains: getSubdomains(josmUrl),
attribution: convertAttributionJosm(props)
attribution: convertAttributionJosm(props),
});
if (props.type && props.type === 'wms') {
@ -268,7 +268,7 @@ BR.LayersConfig = L.Class.extend({
url,
L.Util.extend(josmOptions, {
layers: props.layers,
format: props.format
format: props.format,
})
);
} else {
@ -287,7 +287,7 @@ BR.LayersConfig = L.Class.extend({
layer.id = props.id;
return layer;
}
},
});
BR.layersConfig = function (map) {

View file

@ -4,8 +4,8 @@ BR.Map = {
L.setOptions(this, {
shortcut: {
locate: 76 // char code for 'l'
}
locate: 76, // char code for 'l'
},
});
BR.keys = BR.keys || {};
@ -18,14 +18,14 @@ BR.Map = {
minZoom: 0,
maxZoom: maxZoom,
// fix for route drag on mobile (#285), until next Leaflet version released (> 1.6.0)
tap: false
tap: false,
});
if (BR.Util.getResponsiveBreakpoint() >= '3md') {
L.control
.zoom({
zoomInTitle: i18next.t('keyboard.generic-shortcut', { action: '$t(map.zoomInTitle)', key: '+' }),
zoomOutTitle: i18next.t('keyboard.generic-shortcut', { action: '$t(map.zoomOutTitle)', key: '-' })
zoomOutTitle: i18next.t('keyboard.generic-shortcut', { action: '$t(map.zoomOutTitle)', key: '-' }),
})
.addTo(map);
}
@ -77,7 +77,7 @@ BR.Map = {
minZoom: 1,
maxZoom: 19,
attribution:
'&copy; <a href="https://www.digitalglobe.com/platforms/mapsapi">DigitalGlobe</a> (<a href="https://bit.ly/mapsapiview">Terms of Use</a>)'
'&copy; <a href="https://www.digitalglobe.com/platforms/mapsapi">DigitalGlobe</a> (<a href="https://bit.ly/mapsapiview">Terms of Use</a>)',
}
);
baseLayers[i18next.t('map.layer.digitalglobe')] = recent;
@ -105,10 +105,10 @@ BR.Map = {
var locationControl = L.control
.locate({
strings: {
title: i18next.t('keyboard.generic-shortcut', { action: '$t(map.locate-me)', key: 'L' })
title: i18next.t('keyboard.generic-shortcut', { action: '$t(map.locate-me)', key: 'L' }),
},
icon: 'fa fa-location-arrow',
iconLoading: 'fa fa-spinner fa-pulse'
iconLoading: 'fa fa-spinner fa-pulse',
})
.addTo(map);
L.DomEvent.addListener(
@ -133,7 +133,7 @@ BR.Map = {
return {
map: map,
layersControl: layersControl
layersControl: layersControl,
};
},
@ -157,5 +157,5 @@ BR.Map = {
dl.appendChild(dd);
}
}
}
},
};

View file

@ -106,5 +106,5 @@ BR.Util = {
var temp = document.createElement('div');
temp.textContent = str;
return temp.innerHTML;
}
},
};

View file

@ -95,5 +95,5 @@ BR.ControlLayers = L.Control.Layers.extend({
layer.setZIndex(0);
}
}
}
},
});

View file

@ -3,8 +3,8 @@ BR.Export = L.Class.extend({
options: {
shortcut: {
export: 88 // char code for 'x'
}
export: 88, // char code for 'x'
},
},
initialize: function (router, pois) {
@ -88,13 +88,13 @@ BR.Export = L.Class.extend({
} else if (from === to) {
trackname.value = i18next.t('export.route-loop', {
from: from,
distance: distance
distance: distance,
});
} else {
trackname.value = i18next.t('export.route-from-to', {
from: from,
to: to,
distance: distance
distance: distance,
});
}
@ -137,7 +137,7 @@ BR.Export = L.Class.extend({
this._generateTrackname();
$('#export').modal('show');
}
}
},
});
BR.export = function () {

View file

@ -20,5 +20,5 @@ BR.Itinerary = L.Class.extend({
html += '</pre>';
this._content.innerHTML = html;
}
},
});

View file

@ -16,7 +16,7 @@ BR.Layers = L.Class.extend({
layersData.push([
layer,
this._customLayers[layer].layer._url,
this._customLayers[layer].isOverlay ? 'Overlay' : 'Layer'
this._customLayers[layer].isOverlay ? 'Overlay' : 'Layer',
]);
}
if (this._layersTable != null) {
@ -29,13 +29,13 @@ BR.Layers = L.Class.extend({
searching: false,
paging: false,
language: {
emptyTable: i18next.t('sidebar.layers.table.empty')
emptyTable: i18next.t('sidebar.layers.table.empty'),
},
columns: [
{ title: i18next.t('sidebar.layers.table.name') },
{ title: i18next.t('sidebar.layers.table.URL') },
{ title: i18next.t('sidebar.layers.table.type') }
]
{ title: i18next.t('sidebar.layers.table.type') },
],
});
},
@ -75,10 +75,7 @@ BR.Layers = L.Class.extend({
this._layersControl.removeLayer(this._customLayers[name].layer);
this._map.removeLayer(this._customLayers[name].layer);
delete this._customLayers[name];
this._layersTable
.row('.selected')
.remove()
.draw(false);
this._layersTable.row('.selected').remove().draw(false);
this._sync();
}
},
@ -106,7 +103,7 @@ BR.Layers = L.Class.extend({
this._customLayers[layerName] = {
layer: layer,
isOverlay: isOverlay
isOverlay: isOverlay,
};
if (isOverlay) {
@ -133,5 +130,5 @@ BR.Layers = L.Class.extend({
})
);
}
}
},
});

View file

@ -53,7 +53,7 @@ BR.LayersTab = BR.ControlLayers.extend({
self._layers[i].layer.setStyle({ opacity: opacity });
}
}
}
},
});
L.DomUtil.get('leaflet-control-layers-overlays-opacity-slider').appendChild(overlayOpacitySlider.getElement());
},
@ -163,23 +163,23 @@ BR.LayersTab = BR.ControlLayers.extend({
plugins: ['checkbox'],
checkbox: {
whole_node: false,
tie_selection: false
tie_selection: false,
},
core: {
multiple: false,
themes: {
icons: false,
dots: false
dots: false,
},
data: treeData,
},
data: treeData
}
});
this.jstree = $('#optional-layers-tree').jstree(true);
},
toJsTree: function (layerTree) {
var data = {
children: []
children: [],
};
var self = this;
@ -187,9 +187,9 @@ BR.LayersTab = BR.ControlLayers.extend({
var rootNode = {
text: i18next.t('sidebar.layers.category.' + name, name),
state: {
disabled: true
disabled: true,
},
children: []
children: [],
};
return rootNode;
}
@ -217,8 +217,8 @@ BR.LayersTab = BR.ControlLayers.extend({
id: id,
text: getText(props, parent),
state: {
checked: self.layersConfig.isDefaultLayer(id, props.overlay)
}
checked: self.layersConfig.isDefaultLayer(id, props.overlay),
},
};
}
return childNode;
@ -363,7 +363,7 @@ BR.LayersTab = BR.ControlLayers.extend({
renderer: L.svg({ padding: 1 }),
color: '#333',
fillOpacity: 0.4,
weight: 2
weight: 2,
}).addTo(this._map);
}
},
@ -471,7 +471,7 @@ BR.LayersTab = BR.ControlLayers.extend({
}
}
}
}
},
});
BR.layersTab = function (baseLayers, overlays, options) {

View file

@ -2,7 +2,7 @@ BR.Message = L.Class.extend({
options: {
// true to manually attach click event to close button,
// Bootstrap data-api's auto-initialization doesn't work in Controls because of stopPropagation
alert: false
alert: false,
},
initialize: function (id, options) {
@ -58,7 +58,7 @@ BR.Message = L.Class.extend({
showWarning: function (msg) {
this._show(msg, 'warning');
}
},
});
// static instance as global control

View file

@ -5,7 +5,7 @@ BR.OpacitySlider = L.Class.extend({
orientation: 'vertical',
defaultValue: BR.conf.defaultOpacity,
title: '',
callback: function(opacity) {}
callback: function (opacity) {},
},
initialize: function (options) {
@ -30,7 +30,7 @@ BR.OpacitySlider = L.Class.extend({
orientation: this.options.orientation,
reversed: this.options.reversed,
selection: this.options.reversed ? 'before' : 'after', // inverted, serves as track style, see css
tooltip: 'hide'
tooltip: 'hide',
})
.on('slide slideStop', { self: this }, function (evt) {
evt.data.self.options.callback(evt.value / 100);
@ -65,5 +65,5 @@ BR.OpacitySlider = L.Class.extend({
getElement: function () {
return this.input.slider('getElement');
}
},
});

View file

@ -1,6 +1,6 @@
BR.OpacitySliderControl = L.Control.extend({
options: {
position: 'topleft'
position: 'topleft',
},
onAdd: function (map) {
@ -49,5 +49,5 @@ BR.OpacitySliderControl = L.Control.extend({
});
return container;
}
},
});

View file

@ -5,7 +5,7 @@ BR.Profile = L.Evented.extend({
initialize: function () {
var textArea = L.DomUtil.get('profile_upload');
this.editor = CodeMirror.fromTextArea(textArea, {
lineNumbers: true
lineNumbers: true,
});
$('#profileEditorTabs a[data-toggle="tab"]').on(
@ -22,7 +22,7 @@ BR.Profile = L.Evented.extend({
this.pinned = L.DomUtil.get('profile-pinned');
this.message = new BR.Message('profile_message', {
alert: true
alert: true,
});
},
@ -110,7 +110,7 @@ BR.Profile = L.Evented.extend({
this.saveWarningShown = true;
}
}
}, this)
}, this),
});
},
@ -146,7 +146,7 @@ BR.Profile = L.Evented.extend({
that.profileName = profileId;
that.cache[profileId] = profileText;
}
}
},
});
},
@ -230,7 +230,7 @@ BR.Profile = L.Evented.extend({
description: description,
type: paramType,
value: value,
possible_values: paramValues
possible_values: paramValues,
};
}
});
@ -320,5 +320,5 @@ BR.Profile = L.Evented.extend({
} else {
this._setValue(this._buildCustomProfile(profileText));
}
}
},
});

View file

@ -1,8 +1,8 @@
BR.RoutingOptions = L.Evented.extend({
options: {
shortcut: {
switch: 71 // char code for 'g'
}
switch: 71, // char code for 'g'
},
},
initialize: function () {
@ -58,14 +58,14 @@ BR.RoutingOptions = L.Evented.extend({
return {
profile: profile.val(),
alternative: alternative.val()
alternative: alternative.val(),
};
},
setOptions: function (options) {
var values = [
options.profile ? options.profile : $('#profile option:selected').val(),
options.alternative ? options.alternative : $('#alternative option:selected').val()
options.alternative ? options.alternative : $('#alternative option:selected').val(),
];
$('.selectpicker').selectpicker('val', values);
this.refreshUI();
@ -125,5 +125,5 @@ BR.RoutingOptions = L.Evented.extend({
$('#profile-alternative-form button').click();
}
}
}
},
});

View file

@ -20,8 +20,8 @@ BR.TrackAnalysis = L.Class.extend({
opacity: 0.8,
weight: 8,
// show above quality coding (pane defined in RoutingPathQuality.js)
pane: 'routingQualityPane'
}
pane: 'routingQualityPane',
},
},
/**
@ -125,7 +125,7 @@ BR.TrackAnalysis = L.Class.extend({
var analysis = {
highway: {},
surface: {},
smoothness: {}
smoothness: {},
};
this.totalRouteDistance = 0.0;
@ -158,7 +158,7 @@ BR.TrackAnalysis = L.Class.extend({
),
name: wayTagParts[1],
subtype: trackType,
distance: 0.0
distance: 0.0,
};
}
analysis.highway[highwayType].distance += parseFloat(
@ -175,7 +175,7 @@ BR.TrackAnalysis = L.Class.extend({
),
name: wayTagParts[1],
subtype: '',
distance: 0.0
distance: 0.0,
};
}
analysis[wayTagParts[0]][wayTagParts[1]].distance += parseFloat(
@ -388,9 +388,7 @@ BR.TrackAnalysis = L.Class.extend({
toggleSelected: function (event) {
var tableRow = event.currentTarget;
var $table = $(tableRow)
.parents('table')
.first();
var $table = $(tableRow).parents('table').first();
var dataType = $table.data('type');
var dataName = $(tableRow).data('name');
var trackType = $(tableRow).data('subtype');
@ -512,5 +510,5 @@ BR.TrackAnalysis = L.Class.extend({
}
return result;
}
},
});

View file

@ -5,10 +5,10 @@ BR.TrackMessages = L.Class.extend({
opacity: 0.8,
weight: 8,
// show above quality coding (pane defined in RoutingPathQuality.js)
pane: 'routingQualityPane'
pane: 'routingQualityPane',
},
// center hovered edge (way segment) on map
syncMap: true
syncMap: true,
},
// true when tab is shown, false when hidden
@ -23,7 +23,7 @@ BR.TrackMessages = L.Class.extend({
ElevCost: { title: 'elev$', className: 'dt-body-right' },
TurnCost: { title: 'turn$', className: 'dt-body-right' },
NodeCost: { title: 'node$', className: 'dt-body-right' },
InitialCost: { title: 'initial$', className: 'dt-body-right' }
InitialCost: { title: 'initial$', className: 'dt-body-right' },
},
/**
@ -89,7 +89,7 @@ BR.TrackMessages = L.Class.extend({
// (^= minimum height with flexbox?)
scrollY: 50,
scrollX: true,
order: []
order: [],
});
// highlight track segment (graph edge) on row hover
@ -112,9 +112,7 @@ BR.TrackMessages = L.Class.extend({
if ($.fn.DataTable.isDataTable('#datatable')) {
// destroy option too slow on update, really remove elements with destroy method
$('#datatable')
.DataTable()
.destroy(true);
$('#datatable').DataTable().destroy(true);
// recreate original table element, destroy removes all
ele = document.createElement('table');
@ -135,7 +133,7 @@ BR.TrackMessages = L.Class.extend({
for (k = 0; k < headings.length; k++) {
defaultOptions = {
title: headings[k],
visible: !emptyColumns[k]
visible: !emptyColumns[k],
};
options = L.extend(defaultOptions, this.columnOptions[headings[k]]);
columns.push(options);
@ -210,5 +208,5 @@ BR.TrackMessages = L.Class.extend({
button.classList.toggle('active');
this.options.syncMap = !this.options.syncMap;
}
},
});

View file

@ -12,7 +12,7 @@ BR.TrackStats = L.Class.extend({
var stats = this.calcStats(polyline, segments),
length1 = L.Util.formatNum(stats.trackLength / 1000, 1).toLocaleString(),
length3 = L.Util.formatNum(stats.trackLength / 1000, 3).toLocaleString(undefined, {
minimumFractionDigits: 3
minimumFractionDigits: 3,
}),
formattedAscend = stats.filteredAscend.toLocaleString(),
formattedPlainAscend = stats.plainAscend.toLocaleString(),
@ -46,7 +46,7 @@ BR.TrackStats = L.Class.extend({
plainAscend: 0,
totalTime: 0,
totalEnergy: 0,
cost: 0
cost: 0,
};
var i, props;
@ -61,5 +61,5 @@ BR.TrackStats = L.Class.extend({
}
return stats;
}
},
});

View file

@ -42,14 +42,14 @@
iconBase: 'fa',
tickIcon: 'fa-check',
// don't overlap with footer
windowPadding: [0, 0, 40, 0]
windowPadding: [0, 0, 40, 0],
});
search = new BR.Search();
map.addControl(search);
$('#map .leaflet-control-geocoder > button')[0].title = i18next.t('keyboard.generic-shortcut', {
action: '$t(map.geocoder)',
key: 'F'
key: 'F',
});
router = L.bRouter(); //brouterCgi dummyRouter
@ -65,8 +65,8 @@
},
title: i18next.t('keyboard.generic-shortcut', {
action: '$t(map.draw-route-stop)',
key: '$t(keyboard.escape)'
})
key: '$t(keyboard.escape)',
}),
},
{
stateName: 'activate-draw',
@ -77,10 +77,10 @@
},
title: i18next.t('keyboard.generic-shortcut', {
action: '$t(map.draw-route-start)',
key: 'D'
})
}
]
key: 'D',
}),
},
],
});
var reverseRouteButton = L.easyButton(
@ -90,7 +90,7 @@
},
i18next.t('keyboard.generic-shortcut', {
action: '$t(map.reverse-route)',
key: 'R'
key: 'R',
})
);
@ -101,7 +101,7 @@
},
i18next.t('keyboard.generic-shortcut', {
action: '$t(map.delete-last-point)',
key: 'Z'
key: 'Z',
})
);
@ -112,7 +112,7 @@
},
i18next.t('keyboard.generic-shortcut', {
action: '$t(map.clear-route)',
key: '$t(keyboard.backspace)'
key: '$t(keyboard.backspace)',
})
);
@ -141,16 +141,16 @@
inputOptions: [
{
text: i18next.t('map.delete-route'),
value: 'route'
value: 'route',
},
{
text: i18next.t('map.delete-nogo-areas'),
value: 'nogo'
value: 'nogo',
},
{
text: i18next.t('map.delete-pois'),
value: 'pois'
}
value: 'pois',
},
],
value: ['route'],
callback: function (result) {
@ -167,7 +167,7 @@
onUpdate();
urlHash.onMapMove();
}
}
},
});
}
@ -196,11 +196,11 @@
BR.NogoAreas.MSG_BUTTON = i18next.t('keyboard.generic-shortcut', {
action: '$t(map.nogo.draw)',
key: 'N'
key: 'N',
});
BR.NogoAreas.MSG_BUTTON_CANCEL = i18next.t('keyboard.generic-shortcut', {
action: '$t(map.nogo.cancel)',
key: '$t(keyboard.escape)'
key: '$t(keyboard.escape)',
});
BR.NogoAreas.MSG_CREATE = i18next.t('map.nogo.click-drag');
BR.NogoAreas.MSG_DISABLED = i18next.t('map.nogo.edit');
@ -224,7 +224,7 @@
if (!err) {
routingOptions.setCustomProfile(profileId, true);
updateRoute({
options: routingOptions.getOptions()
options: routingOptions.getOptions(),
});
} else {
profile.message.showError(err);
@ -244,19 +244,19 @@
routingOptions.setCustomProfile(null);
});
trackMessages = new BR.TrackMessages(map, {
requestUpdate: requestUpdate
requestUpdate: requestUpdate,
});
trackAnalysis = new BR.TrackAnalysis(map, {
requestUpdate: requestUpdate
requestUpdate: requestUpdate,
});
routingPathQuality = new BR.RoutingPathQuality(map, layersControl);
routing = new BR.Routing({
routing: {
router: L.bind(router.getRouteSegment, router)
router: L.bind(router.getRouteSegment, router),
},
styles: BR.conf.routingStyles
styles: BR.conf.routingStyles,
});
pois = new BR.PoiMarkers(routing);
@ -311,8 +311,8 @@
listeningTabs: {
tab_profile: profile,
tab_data: trackMessages,
tab_analysis: trackAnalysis
}
tab_analysis: trackAnalysis,
},
}).addTo(map);
if (BR.conf.transit) {
sidebar.showPanel('tab_itinerary');
@ -357,10 +357,10 @@
id: 'route',
title: i18next.t('map.opacity-slider-shortcut', {
action: '$t(map.opacity-slider)',
key: 'M'
key: 'M',
}),
muteKeyCode: 77, // m
callback: L.bind(routing.setOpacity, routing)
callback: L.bind(routing.setOpacity, routing),
})
);
@ -435,7 +435,7 @@
urlHash.onHashChangeCb = onHashChangeCb;
urlHash.onInvalidHashChangeCb = onInvalidHashChangeCb;
urlHash.init(map, {
layersControl: layersControl
layersControl: layersControl,
});
// activate configured default base layer or first if no hash,
@ -491,14 +491,14 @@
{
fallbackLng: 'en',
backend: {
loadPath: 'dist/locales/{{lng}}.json'
}
loadPath: 'dist/locales/{{lng}}.json',
},
},
function (err, t) {
jqueryI18next.init(i18next, $, { useOptionsAttr: true });
$('html').localize();
$('#aboutLinks').localize({
privacyPolicyUrl: BR.conf.privacyPolicyUrl || 'https://brouter.de/privacypolicy.html'
privacyPolicyUrl: BR.conf.privacyPolicyUrl || 'https://brouter.de/privacypolicy.html',
});
mapContext = BR.Map.initMap();

View file

@ -3,7 +3,7 @@ BR.BingLayer = L.BingLayer.extend({
maxZoom: 19,
attribution:
'<a target="_blank" href="https://www.bing.com/maps/">Bing Maps</a>' +
' (<a target="_blank" href="https://go.microsoft.com/?linkid=9710837">TOU</a>)'
' (<a target="_blank" href="https://go.microsoft.com/?linkid=9710837">TOU</a>)',
},
initialize: function (key, options) {
@ -26,5 +26,5 @@ BR.BingLayer = L.BingLayer.extend({
onRemove: function (map) {
L.BingLayer.prototype.onRemove.call(this, map);
map.removeControl(this._logo);
}
},
});

View file

@ -7,9 +7,9 @@ BR.CircleGoArea = L.Control.extend({
shortcut: {
draw: {
enable: 73, // char code for 'i'
disable: 27 // char code for 'ESC'
}
}
disable: 27, // char code for 'ESC'
},
},
},
initialize: function (routing, nogos, pois) {
this.routing = routing;
@ -34,8 +34,8 @@ BR.CircleGoArea = L.Control.extend({
},
title: i18next.t('keyboard.generic-shortcut', {
action: i18next.t('map.draw-circlego-start', { radius: radiusKm }),
key: 'I'
})
key: 'I',
}),
},
{
stateName: 'deactivate-circlego',
@ -45,10 +45,10 @@ BR.CircleGoArea = L.Control.extend({
},
title: i18next.t('keyboard.generic-shortcut', {
action: i18next.t('map.draw-circlego-stop', { radius: radiusKm }),
key: '$t(keyboard.escape)'
})
}
]
key: '$t(keyboard.escape)',
}),
},
],
});
map.on('routing:draw-start', function () {
@ -103,7 +103,13 @@ BR.CircleGoArea = L.Control.extend({
setOutsideArea: function (polygon) {
var inner = polygon.features[0].geometry.coordinates.concat(polygon.features[1].geometry.coordinates);
var world = [[180, 90], [-180, 90], [-180, -90], [180, -90], [180, 90]];
var world = [
[180, 90],
[-180, 90],
[-180, -90],
[180, -90],
[180, 90],
];
polygon.features[0].geometry.coordinates = [world, inner];
polygon.features[0].geometry.type = 'Polygon';
polygon.features.pop();
@ -121,9 +127,9 @@ BR.CircleGoArea = L.Control.extend({
opacity: 0.4,
fillColor: 'black',
fillOpacity: 0.4,
className: 'circlego-outside'
className: 'circlego-outside',
};
}
},
})
.on('click', L.DomEvent.stop)
.addTo(this.map);
@ -137,7 +143,7 @@ BR.CircleGoArea = L.Control.extend({
var self = this;
var icon = L.VectorMarkers.icon({
icon: 'home',
markerColor: BR.conf.markerColors.circlego
markerColor: BR.conf.markerColors.circlego,
});
var marker = L.marker([center[1], center[0]], { icon: icon, draggable: true, name: name })
.on('dragend', function (e) {
@ -223,20 +229,20 @@ BR.CircleGoArea = L.Control.extend({
properties: {},
geometry: {
type: 'LineString',
coordinates: inner.slice(n / 2 - 1)
}
coordinates: inner.slice(n / 2 - 1),
},
},
{
type: 'Feature',
properties: {},
geometry: {
type: 'LineString',
coordinates: inner.slice(0, n / 2 + 1)
}
}
]
coordinates: inner.slice(0, n / 2 + 1),
},
},
],
};
}
},
});
BR.CircleGoArea.include(L.Evented.prototype);

View file

@ -5,12 +5,12 @@ BR.Elevation = L.Control.Elevation.extend({
top: 20,
right: 30,
bottom: 30,
left: 60
left: 60,
},
theme: 'steelblue-theme',
shortcut: {
toggle: 69 // char code for 'e'
}
toggle: 69, // char code for 'e'
},
},
onAdd: function (map) {
@ -19,10 +19,7 @@ BR.Elevation = L.Control.Elevation.extend({
// revert registering touch events when touch screen detection is available and negative
// see https://github.com/MrMufflon/Leaflet.Elevation/issues/67
if (L.Browser.touch && BR.Browser.touchScreenDetectable && !BR.Browser.touchScreen) {
this._background
.on('touchmove.drag', null)
.on('touchstart.drag', null)
.on('touchstart.focus', null);
this._background.on('touchmove.drag', null).on('touchstart.drag', null).on('touchstart.focus', null);
L.DomEvent.off(this._container, 'touchend', this._dragEndHandler, this);
this._background
@ -112,5 +109,5 @@ BR.Elevation = L.Control.Elevation.extend({
if (BR.Util.keyboardShortcutsAllowed(e) && e.keyCode === this.options.shortcut.toggle) {
$('#elevation-btn').click();
}
}
},
});

View file

@ -3,9 +3,9 @@ BR.NogoAreas = L.Control.extend({
shortcut: {
draw: {
enable: 78, // char code for 'n'
disable: 27 // char code for 'ESC'
}
}
disable: 27, // char code for 'ESC'
},
},
},
statics: {
@ -16,7 +16,7 @@ BR.NogoAreas = L.Control.extend({
MSG_ENABLED:
'&square; = move / resize, <span class="fa fa-trash-o"></span> = delete,<br>click nogo to quit editing',
STATE_CREATE: 'no-go-create',
STATE_CANCEL: 'cancel-no-go-create'
STATE_CANCEL: 'cancel-no-go-create',
},
style: {
@ -25,14 +25,14 @@ BR.NogoAreas = L.Control.extend({
opacity: 0.5,
fillColor: null, //same as color by default
fillOpacity: 0.2,
dashArray: null
dashArray: null,
},
editStyle: {
color: '#fe57a1',
opacity: 0.6,
dashArray: '10, 10',
fillOpacity: 0.1
fillOpacity: 0.1,
},
initialize: function () {
@ -54,7 +54,7 @@ BR.NogoAreas = L.Control.extend({
circleEditorClass: BR.DeletableCircleEditor,
// FeatureGroup instead of LayerGroup to propagate events to members
editLayer: new L.FeatureGroup().addTo(map),
featuresLayer: this.drawnItems
featuresLayer: this.drawnItems,
}));
this.startDrawing = function (control) {
@ -76,15 +76,15 @@ BR.NogoAreas = L.Control.extend({
stateName: BR.NogoAreas.STATE_CREATE,
icon: 'fa-ban',
title: BR.NogoAreas.MSG_BUTTON,
onClick: this.startDrawing
onClick: this.startDrawing,
},
{
stateName: BR.NogoAreas.STATE_CANCEL,
icon: 'fa-ban active',
title: BR.NogoAreas.MSG_BUTTON_CANCEL,
onClick: this.stopDrawing
}
]
onClick: this.stopDrawing,
},
],
});
// prevent instant re-activate when turning off button by both Pointer and Click
@ -233,7 +233,7 @@ BR.NogoAreas = L.Control.extend({
var geoJSON = L.geoJson(turf.featureCollection(cleanedGeoJSONFeatures), {
onEachFeature: function (feature, layer) {
layer.options.nogoWeight = feature.properties.nogoWeight || nogoWeight;
}
},
});
var nogosPoints = geoJSON.getLayers().filter(function (e) {
return e.feature.geometry.type === 'Point';
@ -255,7 +255,7 @@ BR.NogoAreas = L.Control.extend({
}),
polylines: geoJSON.getLayers().filter(function (e) {
return e.feature.geometry.type === 'LineString';
})
}),
});
self._fireUpdate();
self.displayUploadError(undefined);
@ -299,7 +299,7 @@ BR.NogoAreas = L.Control.extend({
}),
polylines: this.drawnItems.getLayers().filter(function (e) {
return e instanceof L.Polyline && !(e instanceof L.Polygon);
})
}),
};
},
@ -351,7 +351,7 @@ BR.NogoAreas = L.Control.extend({
getButton: function () {
return this.button;
}
},
});
BR.NogoAreas.include(L.Evented.prototype);
@ -391,12 +391,12 @@ BR.Editable = L.Editable.extend({
createVertexIcon: function (options) {
return BR.Browser.touch ? new L.Editable.TouchVertexIcon(options) : new L.Editable.VertexIcon(options);
}
},
});
BR.EditingTooltip = L.Handler.extend({
options: {
closeTimeout: 2000
closeTimeout: 2000,
},
initialize: function (map, editTools, button) {
@ -434,7 +434,7 @@ BR.EditingTooltip = L.Handler.extend({
var layer = e.layer;
layer.bindTooltip(BR.NogoAreas.MSG_DISABLED, {
direction: 'bottom',
className: 'editing-tooltip'
className: 'editing-tooltip',
});
// Override to set position to south instead of center (circle latlng);
@ -461,7 +461,7 @@ BR.EditingTooltip = L.Handler.extend({
// offset wrong with 'auto' when switching direction
direction: 'right',
offset: L.point(5, 28),
className: 'editing-tooltip-create'
className: 'editing-tooltip-create',
});
// self-reference hack for _moveTooltip, as tooltip is not bound to layer
@ -536,7 +536,7 @@ BR.EditingTooltip = L.Handler.extend({
_disable: function (e) {
e.layer.setTooltipContent(BR.NogoAreas.MSG_DISABLED);
this._setCloseTimeout(e.layer);
}
},
});
BR.DeletableCircleEditor = L.Editable.CircleEditor.extend({
@ -611,7 +611,7 @@ BR.DeletableCircleEditor = L.Editable.CircleEditor.extend({
onVertexMarkerDrag: function (e) {
this._updateDeleteLatLng();
L.Editable.CircleEditor.prototype.onVertexMarkerDrag.call(this, e);
}
},
});
BR.DeleteMarker = L.Marker.extend({
@ -619,8 +619,8 @@ BR.DeleteMarker = L.Marker.extend({
draggable: false,
icon: L.divIcon({
iconSize: BR.Browser.touch ? new L.Point(24, 24) : new L.Point(16, 16),
className: 'leaflet-div-icon fa fa-trash-o nogo-delete-marker'
})
className: 'leaflet-div-icon fa fa-trash-o nogo-delete-marker',
}),
},
initialize: function (latlng, editor, options) {
@ -653,5 +653,5 @@ BR.DeleteMarker = L.Marker.extend({
onClick: function (e) {
this.editor.delete();
}
},
});

View file

@ -6,9 +6,9 @@ BR.PoiMarkers = L.Control.extend({
shortcut: {
draw: {
enable: 80, // char code for 'p'
disable: 27 // char code for 'ESC'
}
}
disable: 27, // char code for 'ESC'
},
},
},
initialize: function (routing) {
this.routing = routing;
@ -29,7 +29,7 @@ BR.PoiMarkers = L.Control.extend({
onClick: function () {
self.draw(true);
},
title: i18next.t('keyboard.generic-shortcut', { action: '$t(map.draw-poi-start)', key: 'P' })
title: i18next.t('keyboard.generic-shortcut', { action: '$t(map.draw-poi-start)', key: 'P' }),
},
{
stateName: 'deactivate-poi',
@ -39,10 +39,10 @@ BR.PoiMarkers = L.Control.extend({
},
title: i18next.t('keyboard.generic-shortcut', {
action: '$t(map.draw-poi-stop)',
key: '$t(keyboard.escape)'
})
}
]
key: '$t(keyboard.escape)',
}),
},
],
}).addTo(map);
map.on('routing:draw-start', function () {
@ -87,14 +87,14 @@ BR.PoiMarkers = L.Control.extend({
if (result !== null) {
self.addMarker(e.latlng, result);
}
}
},
});
},
addMarker: function (latlng, name) {
var icon = L.VectorMarkers.icon({
icon: 'star',
markerColor: BR.conf.markerColors.poi
markerColor: BR.conf.markerColors.poi,
});
var content = BR.Util.sanitizeHTMLContent(name) + '<br>';
@ -135,10 +135,10 @@ BR.PoiMarkers = L.Control.extend({
return this.markersLayer.getLayers().map(function (it) {
return {
latlng: it.getLatLng(),
name: it.options.name
name: it.options.name,
};
});
}
},
});
BR.PoiMarkers.include(L.Evented.prototype);

View file

@ -14,7 +14,7 @@ BR.routeLoader = function(map, layersControl, routing, pois) {
showPointAsPoi: true,
simplifyTolerance: -1,
isTestMode: false,
simplifyLastKnownGood: 0.001
simplifyLastKnownGood: 0.001,
},
setDialogDraggable: function (jqDlgHeader) {
@ -25,7 +25,7 @@ BR.routeLoader = function(map, layersControl, routing, pois) {
$('body').on('mousemove.draggable', function (mousemoveEvt) {
$draggable.closest('.modal-dialog').offset({
left: mousemoveEvt.pageX - x,
top: mousemoveEvt.pageY - y
top: mousemoveEvt.pageY - y,
});
});
$('body').one('mouseup', function () {
@ -40,7 +40,7 @@ BR.routeLoader = function(map, layersControl, routing, pois) {
getSimplifiedCoords: function (tolerance) {
var simplifiedLine = turf.simplify(this._trackPoints.geometry, {
tolerance: tolerance,
highQuality: true
highQuality: true,
});
return simplifiedLine.coordinates;
},
@ -61,7 +61,7 @@ BR.routeLoader = function(map, layersControl, routing, pois) {
L.circleMarker(simplifiedLatLngs[i], {
radius: 6,
fill: false,
color: '#FF0000'
color: '#FF0000',
})
);
}
@ -89,7 +89,7 @@ BR.routeLoader = function(map, layersControl, routing, pois) {
showPointAsPoi: true,
simplifyTolerance: -1,
isTestMode: false,
simplifyLastKnownGood: 0.001
simplifyLastKnownGood: 0.001,
};
},
@ -236,9 +236,7 @@ BR.routeLoader = function(map, layersControl, routing, pois) {
onFileChanged: function (e) {
if (!e.target.files[0]) return;
$(e.target)
.next('label')
.text(e.target.files[0].name);
$(e.target).next('label').text(e.target.files[0].name);
var testmode = this._options.isTestMode;
this.cleanup();
this._options.isTestMode = testmode;
@ -340,7 +338,7 @@ BR.routeLoader = function(map, layersControl, routing, pois) {
var err = event.error;
BR.message.showError(
i18next.t('warning.tracks-load-error', {
error: err && err.message ? err.message : err
error: err && err.message ? err.message : err,
})
);
});
@ -383,7 +381,7 @@ BR.routeLoader = function(map, layersControl, routing, pois) {
if (!this._options.isTestMode) this.addRoutingPoints();
this.onBusyChanged(false);
}
},
});
RouteLoader.include(L.Evented.prototype);

View file

@ -12,7 +12,7 @@ BR.Routing = L.Routing.extend({
normal: L.VectorMarkers.icon({ icon: 'circle', markerColor: BR.conf.markerColors.via }),
end: L.VectorMarkers.icon({ icon: 'stop', markerColor: BR.conf.markerColors.stop }),
draw: false,
opacity: 1
opacity: 1,
},
snapping: null,
zIndexOffset: -2000,
@ -22,16 +22,16 @@ BR.Routing = L.Routing.extend({
offset: 5000,
textFunction: function (distance) {
return distance / 1000;
}
},
},
shortcut: {
draw: {
enable: 68, // char code for 'd'
disable: 27 // char code for 'ESC'
disable: 27, // char code for 'ESC'
},
reverse: 82, // char code for 'r'
deleteLastPoint: 90 // char code for 'z'
}
deleteLastPoint: 90, // char code for 'z'
},
},
onAdd: function (map) {
@ -82,7 +82,7 @@ BR.Routing = L.Routing.extend({
L.divIcon({
className: 'line-mouse-marker',
iconAnchor: [8, 8], // size/2 + border/2
iconSize: [16, 16]
iconSize: [16, 16],
})
);
@ -205,10 +205,10 @@ BR.Routing = L.Routing.extend({
this.options.icons.opacity = opacity;
this._segments.setStyle({
opacity: sourceOpacity
opacity: sourceOpacity,
});
this._segmentsCasing.setStyle({
opacity: sourceOpacity
opacity: sourceOpacity,
});
this._waypoints.eachLayer(function (marker) {
marker.setOpacity(opacity);
@ -327,7 +327,7 @@ BR.Routing = L.Routing.extend({
color: this.options.styles.track.color,
opacity: this.options.styles.trailer.opacity,
dashArray: [10, 10],
className: 'loading-trailer'
className: 'loading-trailer',
});
this._loadingTrailerGroup.addLayer(loadingTrailer);
}
@ -413,5 +413,5 @@ BR.Routing = L.Routing.extend({
this._distanceMarkers = new L.DistanceMarkers(this.toPolyline(), this._map, distanceMarkersOpts);
this._map.addLayer(this._distanceMarkers);
}
}
},
});

View file

@ -2,8 +2,8 @@ BR.RoutingPathQuality = L.Control.extend({
options: {
shortcut: {
toggle: 67, // char code for 'c'
muteKeyCode: 77 // char code for 'm'
}
muteKeyCode: 77, // char code for 'm'
},
},
initialize: function (map, layersControl, options) {
@ -32,10 +32,10 @@ BR.RoutingPathQuality = L.Control.extend({
0.25: '#00ffff', // cyan
0.5: '#00ff00', // green
0.75: '#ffff00', // yellow
1.0: '#ff0000' // red
1.0: '#ff0000', // red
},
outlineColor: 'dimgray',
renderer: renderer
renderer: renderer,
},
valueFunction: function (latLng, prevLatLng) {
var deltaAltitude = latLng.alt - prevLatLng.alt, // in m
@ -44,8 +44,8 @@ BR.RoutingPathQuality = L.Control.extend({
return 0;
}
return (Math.atan(deltaAltitude / distance) * 180) / Math.PI;
}
})
},
}),
},
altitude: {
title: i18next.t('map.route-quality-shortcut', { action: '$t(map.route-quality-altitude)', key: 'C' }),
@ -53,12 +53,12 @@ BR.RoutingPathQuality = L.Control.extend({
provider: new HotLineQualityProvider({
hotlineOptions: {
outlineColor: 'dimgray',
renderer: renderer
renderer: renderer,
},
valueFunction: function (latLng) {
return latLng.alt;
}
})
},
}),
},
cost: {
title: i18next.t('map.route-quality-shortcut', { action: '$t(map.route-quality-cost)', key: 'C' }),
@ -66,7 +66,7 @@ BR.RoutingPathQuality = L.Control.extend({
provider: new HotLineQualityProvider({
hotlineOptions: {
outlineColor: 'dimgray',
renderer: renderer
renderer: renderer,
},
valueFunction: function (latLng) {
var feature = latLng.feature;
@ -78,9 +78,9 @@ BR.RoutingPathQuality = L.Control.extend({
distance;
}
return cost;
}
})
}
},
}),
},
};
this._initialProvider = this.options.initialProvider || 'incline';
this.selectedProvider = this._initialProvider;
@ -138,7 +138,7 @@ BR.RoutingPathQuality = L.Control.extend({
this._activate(btn);
}
}, this);
}, this)(nextState)
}, this)(nextState),
});
}
@ -148,7 +148,7 @@ BR.RoutingPathQuality = L.Control.extend({
}
this.routingPathButton = new L.easyButton({
states: states
states: states,
}).addTo(map);
return new L.DomUtil.create('div');
},
@ -211,7 +211,7 @@ BR.RoutingPathQuality = L.Control.extend({
this._muted = false;
this._activate(this.routingPathButton);
}
}
},
});
var HotLineQualityProvider = L.Class.extend({
@ -285,7 +285,7 @@ var HotLineQualityProvider = L.Class.extend({
}
return {
min: min,
max: max
max: max,
};
}
},
});

View file

@ -2,14 +2,14 @@ BR.Search = L.Control.Geocoder.extend({
options: {
geocoder: new L.Control.Geocoder.LatLng({
next: new L.Control.Geocoder.Nominatim({
serviceUrl: 'https://nominatim.openstreetmap.org/'
serviceUrl: 'https://nominatim.openstreetmap.org/',
}),
sizeInMeters: 800
sizeInMeters: 800,
}),
position: 'topleft',
shortcut: {
search: 70 // char code for 'f'
}
search: 70, // char code for 'f'
},
},
initialize: function (options) {
@ -17,7 +17,7 @@ BR.Search = L.Control.Geocoder.extend({
L.setOptions(this, {
// i18next.t will only return 'undefined' if it is called in a static context
// (e.g. when added directly to "options:" above), so we have to call it here
placeholder: i18next.t('map.geocoder-placeholder')
placeholder: i18next.t('map.geocoder-placeholder'),
});
L.DomEvent.addListener(document, 'keydown', this._keydownListener, this);
@ -25,7 +25,7 @@ BR.Search = L.Control.Geocoder.extend({
markGeocode: function (result) {
this._map.fitBounds(result.geocode.bbox, {
maxZoom: 17
maxZoom: 17,
});
this.clear();
@ -33,7 +33,7 @@ BR.Search = L.Control.Geocoder.extend({
interactive: false,
color: 'red',
opacity: 1,
weight: 3
weight: 3,
}).addTo(this._map);
return this;
@ -50,5 +50,5 @@ BR.Search = L.Control.Geocoder.extend({
$('#map .leaflet-control-geocoder')[0].dispatchEvent(new MouseEvent('mousedown'));
e.preventDefault();
}
}
},
});

View file

@ -9,12 +9,12 @@ BR.Sidebar = L.Control.Sidebar.extend({
defaultTabId: '',
shortcut: {
toggleTabs: 84 // char code for 't'
toggleTabs: 84, // char code for 't'
},
// Tabs to be notified when shown or hidden
// (tab div id -> object implementing show/hide methods)
listeningTabs: {}
listeningTabs: {},
},
initialize: function (id, options) {
@ -142,7 +142,7 @@ BR.Sidebar = L.Control.Sidebar.extend({
this.open(nextTab.attr('href').slice(1));
}
}
}
},
});
BR.sidebar = function (divId, options) {

View file

@ -15,8 +15,8 @@ BR.tracksLoader = function(map, layersControl, routing, pois) {
// File size limit in kb (default: 1024) ?
fileSizeLimit: 1024,
shortcut: {
open: 79 // char code for 'o'
}
open: 79, // char code for 'o'
},
},
_initContainer: function () {
@ -68,7 +68,7 @@ BR.tracksLoader = function(map, layersControl, routing, pois) {
$('#navbarLoadTracks')[0].click();
}
}
}
},
});
var tracksLoaderControl = new TracksLoader();
tracksLoaderControl.addTo(map);
@ -105,7 +105,7 @@ BR.tracksLoader = function(map, layersControl, routing, pois) {
var err = event.error;
BR.message.showError(
i18next.t('warning.tracks-load-error', {
error: err && err.message ? err.message : err
error: err && err.message ? err.message : err,
})
);
console.error(err);

View file

@ -127,5 +127,5 @@ L.DistanceMarkers = L.LayerGroup.extend({
i = Math.floor(i / 2);
}
return zoom;
}
},
});

View file

@ -31,7 +31,7 @@
center: new L.LatLng(lat, lon),
zoom: zoom,
layers: layers,
additional: additional
additional: additional,
};
}
} else {
@ -57,7 +57,7 @@
}),
(L.Hash.prototype = {
options: {
layerSeparator: ','
layerSeparator: ',',
},
map: null,
lastHash: null,
@ -268,7 +268,7 @@
}
}
}
}
},
});
L.hash = function (map, options) {
return new L.Hash(map, options);

View file

@ -4,22 +4,22 @@ BR.stravaSegments = function(map, layersControl) {
runningTitle: i18next.t('map.strava-shortcut', { action: '$t(map.strava-running)', key: 'S' }),
bikingTitle: i18next.t('map.strava-shortcut', { action: '$t(map.strava-biking)', key: 'S' }),
loadingTitle: i18next.t('map.loading'),
stravaToken: BR.keys.strava
stravaToken: BR.keys.strava,
})
.addTo(map);
layersControl.addOverlay(stravaControl.stravaLayer, i18next.t('map.layer.strava-segments'));
stravaControl.onError = function (err) {
BR.message.showError(
i18next.t('warning.strava-error', {
error: err && err.message ? err.message : err
error: err && err.message ? err.message : err,
})
);
};
L.setOptions(this, {
shortcut: {
toggleLayer: 83 // char code for 's'
}
toggleLayer: 83, // char code for 's'
},
});
// hide strava buttons when layer is inactive

View file

@ -12,7 +12,7 @@ L.BRouter = L.Class.extend({
CUSTOM_PREFIX: 'custom_',
isCustomProfile: function (profileName) {
return profileName && profileName.substring(0, 7) === L.BRouter.CUSTOM_PREFIX;
}
},
},
options: {},
@ -108,7 +108,7 @@ L.BRouter = L.Class.extend({
circlego = [
Number.parseFloat(circlego[0]),
Number.parseFloat(circlego[1]),
Number.parseInt(circlego[2])
Number.parseInt(circlego[2]),
];
opts.circlego = circlego;
}
@ -132,7 +132,7 @@ L.BRouter = L.Class.extend({
if (trackname)
args.push(
L.Util.template('trackname={trackname}', {
trackname: trackname
trackname: trackname,
})
);
if (exportWaypoints) args.push('exportWaypoints=1');
@ -248,11 +248,11 @@ L.BRouter = L.Class.extend({
elev: parseInt(featureMessage[5]),
turn: parseInt(featureMessage[6]),
node: parseInt(featureMessage[7]),
initial: parseInt(featureMessage[8])
initial: parseInt(featureMessage[8]),
},
distance: parseInt(featureMessage[3]),
wayTags: featureMessage[9],
nodeTags: featureMessage[10]
nodeTags: featureMessage[10],
};
},
@ -499,7 +499,7 @@ L.BRouter = L.Class.extend({
s += L.BRouter.NUMBER_SEPARATOR;
s += L.Util.formatNum(latLng.lat || latLng[0], L.BRouter.PRECISION);
return s;
}
},
});
L.bRouter = function (options) {

View file

@ -15,7 +15,7 @@ var brouterCgi = (function() {
toLat: L.Util.formatNum(latLngs[1].lat, PRECISION),
toLng: L.Util.formatNum(latLngs[1].lng, PRECISION),
profile: 'trekking',
alt: '0'
alt: '0',
};
var url = L.Util.template(URL_TEMPLATE, urlParams);
//console.log(url);
@ -24,6 +24,6 @@ var brouterCgi = (function() {
}
return {
getUrl: getUrl
getUrl: getUrl,
};
})();

View file

@ -15,7 +15,7 @@ BR.Track = {
var currentLayerId = layersControl.getActiveBaseLayer().layer.id;
return {
color: currentLayerId === 'cyclosm' ? 'yellow' : 'blue',
weight: 4
weight: 4,
};
},
interactive: false,
@ -29,9 +29,9 @@ BR.Track = {
interactive: false,
opacity: 0.7,
// prevent being on top of route markers
zIndexOffset: -1000
zIndexOffset: -1000,
});
}
},
};
},
@ -79,5 +79,5 @@ BR.Track = {
*/
isPoiPoint: function (geoJsonFeature) {
return turf.getType(geoJsonFeature) === 'Point' && !BR.Track.isRouteWaypoint(geoJsonFeature);
}
},
};

View file

@ -75,5 +75,5 @@ BR.TrackEdges = L.Class.extend({
lat = message[1] / 1000000;
return L.latLng(lat, lon);
}
},
});

View file

@ -15,6 +15,6 @@
strava: '',
// OpenMapSurfer (OpenRouteService API), https://openrouteservice.org/plans/
openrouteservice: ''
openrouteservice: '',
};
})();

View file

@ -49,9 +49,9 @@
"d3": "~3.5.5",
"datatables": "~1.10.18",
"font-awesome": "^4.7.0",
"i18next": "^15.0.4",
"i18next-browser-languagedetector": "^3.0.1",
"i18next-xhr-backend": "^2.0.1",
"i18next": "^19.8.4",
"i18next-browser-languagedetector": "^6.0.1",
"i18next-xhr-backend": "^3.2.2",
"jquery": "3.5.1",
"jquery-i18next": "^1.2.1",
"jstree": "^3.3.8",
@ -72,45 +72,44 @@
"leaflet.snogylop": "^0.4.0",
"leaflet.stravasegments": "2.3.2",
"mapbbcode": "MapBBCode/mapbbcode#v1.2.0",
"promise-polyfill": "^8.1.0",
"tether": "1.4.5",
"promise-polyfill": "^8.2.0",
"url-search-params": "~0.5.0",
"whatwg-fetch": "^3.0.0"
"whatwg-fetch": "^3.5.0"
},
"devDependencies": {
"autoprefixer": "^8.1.0",
"browser-sync": "^2.26.13",
"del": "^1.1.1",
"eslint": "^6.6.0",
"eslint": "^7.15.0",
"eslint-plugin-compat": "^3.3.0",
"gulp": "^4.0.2",
"gulp-bump": "^2.7.0",
"gulp-bump": "^3.2.0",
"gulp-cached": "^1.0.4",
"gulp-clean-css": "^4.0.0",
"gulp-clean-css": "^4.3.0",
"gulp-concat": "^2.5.2",
"gulp-confirm": "^1.0.6",
"gulp-debug": "^2.0.1",
"gulp-git": "^2.2.0",
"gulp-debug": "^4.0.0",
"gulp-git": "^2.10.1",
"gulp-github-release": "^1.2.1",
"gulp-if": "^2.0.0",
"gulp-inject": "^1.2.0",
"gulp-if": "^3.0.0",
"gulp-inject": "^5.0.5",
"gulp-json-concat": "^0.1.1",
"gulp-modify-css-urls": "^2.0.0",
"gulp-postcss": "^7.0.1",
"gulp-remember": "^0.3.0",
"gulp-rename": "^1.4.0",
"gulp-replace": "^0.5.4",
"gulp-sourcemaps": "^1.5.1",
"gulp-uglify": "^1.1.0",
"gulp-postcss": "^9.0.0",
"gulp-remember": "^1.0.1",
"gulp-rename": "^2.0.0",
"gulp-replace": "^1.0.0",
"gulp-sourcemaps": "^3.0.0",
"gulp-uglify": "^3.0.2",
"gulp-util": "^3.0.7",
"gulp-zip": "^4.0.0",
"husky": "^2.3.0",
"i18next-scanner": "^2.9.1",
"gulp-zip": "^5.0.2",
"husky": "^4.3.4",
"i18next-scanner": "^3.0.0",
"merge-stream": "^2.0.0",
"node-fetch": "^2.6.1",
"npmfiles": "^0.1.1",
"prettier": "^1.17.1",
"pretty-quick": "^1.10.0"
"npmfiles": "^0.1.3",
"prettier": "^2.2.1",
"pretty-quick": "^3.1.0"
},
"overrides": {
"leaflet": {

2097
yarn.lock

File diff suppressed because it is too large Load diff