prevent map panels from covering up edit menu, fixes #10495 (#10586)

This commit is contained in:
Devin Fahnestock
2024-12-13 09:08:50 -05:00
committed by GitHub
parent bb2596aa9b
commit 313022728c
3 changed files with 14 additions and 5 deletions
+4
View File
@@ -6,6 +6,7 @@ import { localizer } from '../core/localizer';
import { uiTooltip } from './tooltip';
import { utilRebind } from '../util/rebind';
import { utilHighlightEntities } from '../util/util';
import { utilGetDimensions } from '../util/dimensions';
import { svgIcon } from '../svg/icon';
@@ -226,6 +227,9 @@ export function uiEditMenu(context) {
}
var origin = geoVecAdd(anchorLoc, offset);
// repositioning the menu to account for the top menu height
var _verticalOffset = parseFloat(utilGetDimensions(d3_select('.top-toolbar-wrap'))[1]);
origin[1] -= _verticalOffset;
_menu
.style('left', origin[0] + 'px')
+8 -5
View File
@@ -54,6 +54,7 @@ export function uiInit(context) {
var _lastPointerType;
var overMap;
function render(container) {
@@ -160,7 +161,7 @@ export function uiInit(context) {
.attr('dir', 'ltr')
.call(map);
var overMap = content
overMap = content
.append('div')
.attr('class', 'over-map');
@@ -665,14 +666,16 @@ export function uiInit(context) {
.triggerType(triggerType)
.operations(operations);
// render the menu
context.map().supersurface.call(_editMenu);
// render the menu onto the overmap
overMap
.call(_editMenu);
};
ui.closeEditMenu = function() {
// remove any existing menu no matter how it was added
context.map().supersurface
.select('.edit-menu').remove();
if (overMap !== undefined) {
overMap.select('.edit-menu').remove();
}
};