From: Philipp Spitzer Date: Sat, 2 Jan 2021 13:53:19 +0000 (+0100) Subject: Use "Select" interaction for selecting features. X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/mediawiki_extensions/wrmap.git/commitdiff_plain/63bce95d8c6fba2ed25c6706871fc95408479e06 Use "Select" interaction for selecting features. --- diff --git a/wrmap.js b/wrmap.js index b52b511..1aa9926 100644 --- a/wrmap.js +++ b/wrmap.js @@ -363,7 +363,12 @@ function init_wrmap(i, jq_map) { style: style_function_selected, }); map.addInteraction(select_hover); - map.on('singleclick', function(event) { + + var select_click = new ol.interaction.Select({ + condition: ol.events.condition.click, + }); + map.addInteraction(select_click); + select_click.on('select', function(event) { popup_content.innerHTML = '

You clicked

'; popup_overlay.setPosition(event.coordinate); });