From 7df38575b847f7cd5356db07e9f1b3711ee8e6a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Kr=C3=B6g?= Date: Sat, 6 Feb 2021 18:50:35 +0100 Subject: [PATCH] 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 --- examples/measure.css | 2 ++ examples/measure.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/examples/measure.css b/examples/measure.css index d7cff60da3..d4bd28c6ce 100644 --- a/examples/measure.css +++ b/examples/measure.css @@ -7,6 +7,8 @@ opacity: 0.7; white-space: nowrap; font-size: 12px; + cursor: default; + user-select: none; } .ol-tooltip-measure { opacity: 1; diff --git a/examples/measure.js b/examples/measure.js index 6e4b1e2530..e1d52a010b 100644 --- a/examples/measure.js +++ b/examples/measure.js @@ -248,6 +248,8 @@ function createMeasureTooltip() { element: measureTooltipElement, offset: [0, -15], positioning: 'bottom-center', + stopEvent: false, + insertFirst: false, }); map.addOverlay(measureTooltip); }