From cd069e30fbc76f58715269bfe08f9a972cd6698a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Kr=C3=B6g?= Date: Sat, 1 Aug 2020 00:34:22 +0200 Subject: [PATCH] Show the popup over in front of the other overlays --- examples/overlay.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/overlay.js b/examples/overlay.js index 7e8282da21..f84271782e 100644 --- a/examples/overlay.js +++ b/examples/overlay.js @@ -21,6 +21,12 @@ const map = new Map({ const pos = fromLonLat([16.3725, 48.208889]); +// Popup showing the position the user clicked +const popup = new Overlay({ + element: document.getElementById('popup'), +}); +map.addOverlay(popup); + // Vienna marker const marker = new Overlay({ position: pos, @@ -37,12 +43,6 @@ const vienna = new Overlay({ }); map.addOverlay(vienna); -// Popup showing the position the user clicked -const popup = new Overlay({ - element: document.getElementById('popup'), -}); -map.addOverlay(popup); - map.on('click', function (evt) { const element = popup.getElement(); const coordinate = evt.coordinate;