Call customPopupCallback even if no customPopup
This commit is contained in:
parent
52a2ce3838
commit
44d41ce017
1 changed files with 3 additions and 3 deletions
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…
Add table
Add a link
Reference in a new issue