diff --git a/data/core.yaml b/data/core.yaml index dcbab69459..7336fcebaf 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -1696,6 +1696,7 @@ en: fullscreen: "Enter full screen mode" sidebar: "Toggle sidebar" wireframe: "Toggle wireframe mode" + osm_data: "Toggle OpenStreetMap data" minimap: "Toggle minimap" selecting: title: "Selecting features" diff --git a/data/shortcuts.json b/data/shortcuts.json index cdda162904..d043d7fd09 100644 --- a/data/shortcuts.json +++ b/data/shortcuts.json @@ -74,6 +74,11 @@ "shortcuts": ["area_fill.wireframe.key"], "text": "shortcuts.browsing.display_options.wireframe" }, + { + "modifiers": ["⌥"], + "shortcuts": ["area_fill.wireframe.key"], + "text": "shortcuts.browsing.display_options.osm_data" + }, { "shortcuts": ["background.minimap.key"], "text": "shortcuts.browsing.display_options.minimap" diff --git a/dist/locales/en.json b/dist/locales/en.json index 0eebd71461..b608adfbf8 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -2055,6 +2055,7 @@ "fullscreen": "Enter full screen mode", "sidebar": "Toggle sidebar", "wireframe": "Toggle wireframe mode", + "osm_data": "Toggle OpenStreetMap data", "minimap": "Toggle minimap" }, "selecting": { diff --git a/modules/ui/map_data.js b/modules/ui/map_data.js index 60d87eef59..ba498083da 100644 --- a/modules/ui/map_data.js +++ b/modules/ui/map_data.js @@ -11,10 +11,12 @@ import { modeBrowse } from '../modes'; import { uiDisclosure } from './disclosure'; import { uiSettingsCustomData } from './settings/custom_data'; import { uiTooltipHtml } from './tooltipHtml'; +import { uiCmd } from './cmd'; export function uiMapData(context) { var key = t('map_data.key'); + var osmDataToggleKey = uiCmd('⌥' + t('area_fill.wireframe.key')); var features = context.features().keys(); var layers = context.layers(); var fills = ['wireframe', 'partial', 'full']; @@ -277,11 +279,20 @@ export function uiMapData(context) { var labelEnter = liEnter .append('label') .each(function(d) { - d3_select(this) - .call(tooltip() - .title(t('map_data.layers.' + d.id + '.tooltip')) - .placement('bottom') - ); + if (d.id === 'osm') { + d3_select(this) + .call(tooltip() + .html(true) + .title(uiTooltipHtml(t('map_data.layers.' + d.id + '.tooltip'), osmDataToggleKey)) + .placement('bottom') + ); + } else { + d3_select(this) + .call(tooltip() + .title(t('map_data.layers.' + d.id + '.tooltip')) + .placement('bottom') + ); + } }); labelEnter @@ -820,7 +831,12 @@ export function uiMapData(context) { context.keybinding() .on(key, uiMapData.togglePane) - .on(t('area_fill.wireframe.key'), toggleWireframe); + .on(t('area_fill.wireframe.key'), toggleWireframe) + .on(osmDataToggleKey, function() { + d3_event.preventDefault(); + d3_event.stopPropagation(); + toggleLayer('osm'); + }); }; return uiMapData;