Show the popup over in front of the other overlays

This commit is contained in:
Maximilian Krög
2020-08-01 00:34:22 +02:00
parent 302bc662af
commit cd069e30fb

View File

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