diff --git a/modules/ui/preferences.js b/modules/ui/preferences.js index 3da2031c3..1b4364378 100644 --- a/modules/ui/preferences.js +++ b/modules/ui/preferences.js @@ -10,7 +10,7 @@ import { uiTooltipHtml } from './tooltipHtml'; export function uiPreferences(context) { const key = t('preferences.key'); let _pane = d3_select(null); - let _showThirdPartyIcons = context.storage('preferences.privacy.thirdpartyicons') || true; + let _showThirdPartyIcons = context.storage('preferences.privacy.thirdpartyicons') || 'true'; const paneTooltip = tooltip() .placement((textDirection === 'rtl') ? 'right' : 'left') @@ -40,7 +40,7 @@ export function uiPreferences(context) { .attr('type', 'checkbox') .on('change', () => { d3_event.preventDefault(); - _showThirdPartyIcons = !_showThirdPartyIcons; + _showThirdPartyIcons = (_showThirdPartyIcons === 'true') ? 'false' : 'true'; context.storage('preferences.privacy.thirdpartyicons', _showThirdPartyIcons); update(); }); @@ -68,9 +68,9 @@ export function uiPreferences(context) { function update() { selection.selectAll('.privacy-third-party-icons-item') - .classed('active', _showThirdPartyIcons) + .classed('active', (_showThirdPartyIcons === 'true')) .select('input') - .property('checked', _showThirdPartyIcons); + .property('checked', (_showThirdPartyIcons === 'true')); } } diff --git a/modules/ui/preset_icon.js b/modules/ui/preset_icon.js index e744e3e74..7a1f7f701 100644 --- a/modules/ui/preset_icon.js +++ b/modules/ui/preset_icon.js @@ -231,8 +231,10 @@ export function uiPresetIcon(context) { if (geom === 'relation' && p.tags && ((p.tags.type === 'route' && p.tags.route && routeSegments[p.tags.route]) || p.tags.type === 'waterway')) { geom = 'route'; } + + const showThirdPartyIcons = context.storage('preferences.privacy.thirdpartyicons') || 'true'; const isFallback = isSmall() && p.isFallback && p.isFallback(); - const imageURL = p.imageURL; + const imageURL = (showThirdPartyIcons === 'true') && p.imageURL; const picon = getIcon(p, geom); const isMaki = picon && /^maki-/.test(picon); const isTemaki = picon && /^temaki-/.test(picon);