Call customPopupCallback even if no customPopup

This commit is contained in:
Chandler Swift 2024-03-12 00:10:03 -05:00
parent 52a2ce3838
commit 44d41ce017
Signed by: chandlerswift
GPG key ID: A851D929D52FB93F

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