From 74011a4b8f250cdcce4ab4582a5e12bc2100ef9d Mon Sep 17 00:00:00 2001 From: Philipp Spitzer Date: Sat, 2 Jan 2021 15:21:33 +0100 Subject: [PATCH 1/1] Popup works again. --- wrmap.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wrmap.js b/wrmap.js index 72d48ad..878b709 100644 --- a/wrmap.js +++ b/wrmap.js @@ -384,8 +384,12 @@ function init_wrmap(i, jq_map) { }); map.addInteraction(select_click); select_click.on('select', function(event) { - popup_content.innerHTML = '

You clicked

'; - popup_overlay.setPosition(event.coordinate); + if (event.selected.length > 0) { + let feature = event.selected[0]; + let coordinates = feature.getGeometry().getCoordinates(); + popup_content.innerHTML = '

You clicked

'; + popup_overlay.setPosition(coordinates); + } }); /* -- 2.39.5