Merge pull request #11376 from MoonE/examples-fix-overlay-order

Overlay Eample - Show the popup in front of the other overlays
This commit is contained in:
Tim Schaub
2020-08-01 15:27:19 -06:00
committed by GitHub

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;