Call customPopupCallback even if no customPopup

main
Chandler Swift 2024-03-12 00:10:03 -05:00
parent 52a2ce3838
commit 44d41ce017
Signed by: chandlerswift
GPG Key ID: A851D929D52FB93F
1 changed files with 3 additions and 3 deletions

View File

@ -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);