Restore latest imagery used from local storage

This commit is contained in:
Gautier Pelloux-Prayer
2018-01-21 22:42:01 +01:00
parent b69ce83558
commit 5077f88a4d
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -386,6 +386,7 @@ export function rendererBackground(context) {
background.baseLayerSource(
background.findSource(requested) ||
best ||
background.findSource(context.storage('background-last-used')) ||
background.findSource('Bing') ||
first ||
background.findSource('none')
+3 -1
View File
@@ -30,7 +30,7 @@ export function uiBackground(context) {
var key = t('background.key');
var _customSource = context.background().findSource('custom');
var _previousBackground;
var _previousBackground = context.background().findSource(context.storage('background-previous-last-used'));
var _shown = false;
var _backgroundList = d3_select(null);
@@ -92,6 +92,8 @@ export function uiBackground(context) {
d3_event.preventDefault();
_previousBackground = context.background().baseLayerSource();
context.storage('background-previous-last-used', _previousBackground.id);
context.storage('background-last-used', d.id);
context.background().baseLayerSource(d);
_backgroundList.call(updateLayerSelections);
document.activeElement.blur();