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:
@@ -33,8 +33,11 @@ map.on('singleclick', function(evt) {
|
|||||||
evt.coordinate, viewResolution, 'EPSG:3857',
|
evt.coordinate, viewResolution, 'EPSG:3857',
|
||||||
{'INFO_FORMAT': 'text/html'});
|
{'INFO_FORMAT': 'text/html'});
|
||||||
if (url) {
|
if (url) {
|
||||||
document.getElementById('info').innerHTML =
|
fetch(url)
|
||||||
'<iframe seamless src="' + url + '"></iframe>';
|
.then((response) => response.text())
|
||||||
|
.then((html) => {
|
||||||
|
document.getElementById('info').innerHTML = html;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user