diff --git a/main.js b/main.js index 121bbf5..652a83e 100644 --- a/main.js +++ b/main.js @@ -161,15 +161,15 @@ map.on('click', function (evt) { } if (layer.hasOwnProperty('customPopup')) { content.innerHTML = layer.customPopup(feature); - if (layer.hasOwnProperty('customPopupCallback')) { - layer.customPopupCallback(feature); - } } else { // exclude geometry -- https://stackoverflow.com/a/208106 const {geometry: _, ...featureData} = feature.getProperties(); content.innerHTML = objectToTable(featureData); } + if (layer.hasOwnProperty('customPopupCallback')) { + layer.customPopupCallback(feature); + } popupOverlay.setPosition(evt.coordinate);