Add required referrer when loading tiles from openstreetmap.org

Signed-off-by: Maximilian Krög <maximilian.kroeg@geocept.com>
This commit is contained in:
Maximilian Krög 2026-03-17 10:56:24 +01:00
parent 4c0760bf5d
commit b2f5a93986
No known key found for this signature in database
GPG Key ID: 093352DE4ADAEA2C

View File

@ -446,7 +446,13 @@ class GisVisualization
. 'target: \'openlayersmap\','
. 'layers: ['
. 'new ol.layer.Tile({'
. 'source: new ol.source.OSM()'
. 'source: new ol.source.OSM({'
. 'tileLoadFunction: function (imageTile, src) {'
. 'const image = imageTile.getImage();'
. 'if (image instanceof HTMLImageElement) {'
. "image.referrerPolicy = 'origin-when-cross-origin';"
. '}'
. 'image.src = src; }})'
. '}),'
. 'new ol.layer.Vector({'
. 'source: vectorLayer'