diff --git a/config.js b/config.js index 7182a85..9a2c856 100644 --- a/config.js +++ b/config.js @@ -78,6 +78,9 @@ //'Mapsforge Tile Server': 'http://localhost:6090/{z}/{x}/{y}.png' }; + // Initial route line transparency (0-1, overridden by stored slider setting) + BR.conf.defaultOpacity = 0.67; + // Minimum transparency slider value on load, values between 0 and 1 (0=invisible). // 0 = no minimum, use stored setting; 1 = always reset to full visibility on load BR.conf.minOpacity = 0.3; diff --git a/js/control/OpacitySlider.js b/js/control/OpacitySlider.js index 3123789..847c961 100644 --- a/js/control/OpacitySlider.js +++ b/js/control/OpacitySlider.js @@ -8,7 +8,7 @@ BR.OpacitySlider = L.Control.extend({ var container = L.DomUtil.create('div', 'leaflet-bar control-slider'), input = $(''), item = localStorage.opacitySliderValue, - value = item ? parseInt(item) : 100, + value = item ? parseInt(item) : BR.conf.defaultOpacity * 100, minOpacity = (BR.conf.minOpacity || 0) * 100; if (value < minOpacity) { diff --git a/js/index.js b/js/index.js index 672652b..4838e0a 100644 --- a/js/index.js +++ b/js/index.js @@ -251,13 +251,13 @@ }, track: { color: 'magenta', - opacity: 1 + opacity: BR.conf.defaultOpacity }, trackCasing: { weight: 8, color: 'white', // assumed to be same as track, see setOpacity - opacity: 1 + opacity: BR.conf.defaultOpacity }, nodata: { color: 'darkred'