Fix issue where hover sidebar wouldn't be closed when zooming out past editable extent (close #7765)

This commit is contained in:
Quincy Morgan
2020-07-13 15:47:12 -04:00
parent 0112547c89
commit cf868464f4
2 changed files with 8 additions and 1 deletions

View File

@@ -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;
}

View File

@@ -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() {};