Use getProperties instead of undocumented var
This commit is contained in:
parent
2242863fdd
commit
d96415b1c5
|
@ -38,23 +38,23 @@ for (let [state, url] of Object.entries(allStates)) {
|
|||
return new Style({
|
||||
image: new Icon({
|
||||
anchor: [0.5, 1],
|
||||
src: feature.values_.views[0].hasVideo ? pinVideo : pin,
|
||||
src: feature.getProperties().views[0].hasVideo ? pinVideo : pin,
|
||||
}),
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
vectorLayer.customPopup = function(feature) {
|
||||
const view = feature.values_.views[0];
|
||||
const view = feature.getProperties().views[0];
|
||||
if (view.hasVideo) {
|
||||
return `<p>${feature.values_.name}</p><video style="max-width: 80vw; max-height: 80vh;" id="popupVideo" autoplay controls></video>`;
|
||||
return `<p>${feature.getProperties().name}</p><video style="max-width: 80vw; max-height: 80vh;" id="popupVideo" autoplay controls></video>`;
|
||||
} else {
|
||||
return `<img style="max-width: 80vw; max-height: 80vh;" src="${view.src}">`;
|
||||
}
|
||||
};
|
||||
|
||||
vectorLayer.customPopupCallback = function(feature) {
|
||||
const view = feature.values_.views[0];
|
||||
const view = feature.getProperties().views[0];
|
||||
if (view.hasVideo) {
|
||||
const video = document.getElementById('popupVideo');
|
||||
|
||||
|
|
2
main.js
2
main.js
|
@ -141,7 +141,7 @@ map.on('click', function (evt) {
|
|||
}
|
||||
} else {
|
||||
// exclude geometry -- https://stackoverflow.com/a/208106
|
||||
const {geometry: _, ...featureData} = feature.values_;
|
||||
const {geometry: _, ...featureData} = feature.getProperties();
|
||||
|
||||
content.innerHTML = objectToTable(featureData);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue