Skip to content

Commit

Permalink
default opacity 0.67 (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
nrenner committed Jun 14, 2016
1 parent a54cc31 commit 83ce7ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion js/control/OpacitySlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ BR.OpacitySlider = L.Control.extend({
var container = L.DomUtil.create('div', 'leaflet-bar control-slider'),
input = $('<input id="slider" type="text"/>'),
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) {
Expand Down
4 changes: 2 additions & 2 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 83ce7ff

Please sign in to comment.