diff --git a/config.js b/config.js index a3c14dd..0568315 100644 --- a/config.js +++ b/config.js @@ -67,4 +67,7 @@ //'Mapsforge Tile Server': 'http://localhost:6090/{z}/{x}/{y}.png' }; + // 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 38ec888..3123789 100644 --- a/js/control/OpacitySlider.js +++ b/js/control/OpacitySlider.js @@ -8,7 +8,12 @@ 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) : 100, + minOpacity = (BR.conf.minOpacity || 0) * 100; + + if (value < minOpacity) { + value = minOpacity; + } var stopClickAfterSlide = function(evt) { L.DomEvent.stop(evt);