Remove IFrame usage in GetFeatureInfo tile example

This replaces the loading of the GetFeatureInfo request via IFrame by a
fetch operation in the GetFeatureInfo tile example.
This commit is contained in:
Christian Mayer
2019-02-27 09:19:21 +01:00
parent 3aa93014c0
commit 85f2312370

View File

@@ -33,8 +33,11 @@ map.on('singleclick', function(evt) {
evt.coordinate, viewResolution, 'EPSG:3857',
{'INFO_FORMAT': 'text/html'});
if (url) {
document.getElementById('info').innerHTML =
'<iframe seamless src="' + url + '"></iframe>';
fetch(url)
.then((response) => response.text())
.then((html) => {
document.getElementById('info').innerHTML = html;
});
}
});