diff --git a/modules/renderer/map.js b/modules/renderer/map.js index 273f17812..ab0a1290f 100644 --- a/modules/renderer/map.js +++ b/modules/renderer/map.js @@ -593,7 +593,7 @@ export function rendererMap(context) { if (_lastWithinEditableZoom !== withinEditableZoom) { if (_lastWithinEditableZoom !== undefined) { // notify that the map zoomed in or out over the editable zoom threshold - dispatch.call('crossEditableZoom', this, map); + dispatch.call('crossEditableZoom', this, withinEditableZoom); } _lastWithinEditableZoom = withinEditableZoom; } diff --git a/modules/ui/sidebar.js b/modules/ui/sidebar.js index 0f87ceecb..6eddadaaf 100644 --- a/modules/ui/sidebar.js +++ b/modules/ui/sidebar.js @@ -412,6 +412,13 @@ export function uiSidebar(context) { // toggle the sidebar collapse when double-clicking the resizer resizer.on('dblclick', sidebar.toggle); + + // ensure hover sidebar is closed when zooming out beyond editable zoom + context.map().on('crossEditableZoom.sidebar', function(within) { + if (!within && !selection.select('.inspector-hover').empty()) { + hover([]); + } + }); } sidebar.showPresetList = function() {};