Improve measure example ux

- Pass click events on measure tooltips through to the map
- Put the tooltip for  the currently drawn geometry on top
- Disable text selection in the tooltips so clicking to draw does not select
This commit is contained in:
Maximilian Krög
2021-02-06 18:50:35 +01:00
parent 3eb5dcca68
commit 7df38575b8
2 changed files with 4 additions and 0 deletions

View File

@@ -7,6 +7,8 @@
opacity: 0.7;
white-space: nowrap;
font-size: 12px;
cursor: default;
user-select: none;
}
.ol-tooltip-measure {
opacity: 1;

View File

@@ -248,6 +248,8 @@ function createMeasureTooltip() {
element: measureTooltipElement,
offset: [0, -15],
positioning: 'bottom-center',
stopEvent: false,
insertFirst: false,
});
map.addOverlay(measureTooltip);
}