diff --git a/modules/ui/background.js b/modules/ui/background.js index 9f572960f..295c44530 100644 --- a/modules/ui/background.js +++ b/modules/ui/background.js @@ -30,7 +30,7 @@ export function uiBackground(context) { var key = t('background.key'); var _customSource = context.background().findSource('custom'); - var _previousBackground = context.background().findSource(context.storage('background-previous-last-used')); + var _previousBackground = context.background().findSource(context.storage('background-last-used-toggle')); var _shown = false; var _backgroundList = d3_select(null); @@ -92,7 +92,7 @@ export function uiBackground(context) { d3_event.preventDefault(); _previousBackground = context.background().baseLayerSource(); - context.storage('background-previous-last-used', _previousBackground.id); + context.storage('background-last-used-toggle', _previousBackground.id); context.storage('background-last-used', d.id); context.background().baseLayerSource(d); _backgroundList.call(updateLayerSelections); diff --git a/modules/ui/map_data.js b/modules/ui/map_data.js index 690b76a0a..457a43be5 100644 --- a/modules/ui/map_data.js +++ b/modules/ui/map_data.js @@ -20,8 +20,7 @@ export function uiMapData(context) { var layers = context.layers(); var fills = ['wireframe', 'partial', 'full']; - var _fillDefault = context.storage('area-fill') || 'partial'; - var _fillSelected = _fillDefault !== 'wireframe' ? _fillDefault : 'partial'; + var _fillSelected = context.storage('area-fill') || 'partial'; var _shown = false; var _dataLayerContainer = d3_select(null); var _fillList = d3_select(null); @@ -55,10 +54,10 @@ export function uiMapData(context) { }); _fillSelected = d; - if (d !== 'wireframe') { - _fillDefault = d; - } context.storage('area-fill', d); + if (d !== 'wireframe') { + context.storage('area-fill-toggle', d); + } update(); } @@ -385,7 +384,14 @@ export function uiMapData(context) { d3_event.preventDefault(); d3_event.stopPropagation(); } - setFill((_fillSelected === 'wireframe' ? _fillDefault : 'wireframe')); + + if (_fillSelected === 'wireframe') { + _fillSelected = context.storage('area-fill-toggle') || 'partial'; + } else { + _fillSelected = 'wireframe'; + } + + setFill(_fillSelected); context.map().pan([0,0]); // trigger a redraw } @@ -489,7 +495,7 @@ export function uiMapData(context) { .on('change.map_data-update', update); update(); - setFill(_fillDefault); + setFill(_fillSelected); var keybinding = d3_keybinding('features') .on(key, togglePane)