From: Philipp Spitzer Date: Sat, 2 Jan 2021 16:34:28 +0000 (+0100) Subject: Only show popups if they are not empty. X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/mediawiki_extensions/wrmap.git/commitdiff_plain/8099b07021f27ad49417f4c7a86928d084ce6f08?hp=cdd61a90252d38d533ee24bd2612893f0479451c Only show popups if they are not empty. --- diff --git a/wrmap.js b/wrmap.js index 40c5773..af6f136 100644 --- a/wrmap.js +++ b/wrmap.js @@ -376,8 +376,10 @@ function init_wrmap(i, jq_map) { let feature = event.selected[0]; let coordinates = feature.getGeometry().getCoordinates(); let popup_dom = create_popup_dom(feature); - $(popup_content).empty().append(popup_dom); - popup_overlay.setPosition(coordinates); + if (popup_dom.children().length > 0) { + $(popup_content).empty().append(popup_dom); + popup_overlay.setPosition(coordinates); + } } }); }