Call customPopupCallback even if no customPopup
This commit is contained in:
parent
52a2ce3838
commit
44d41ce017
6
main.js
6
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue