diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2026-05-20 11:23:50 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2026-05-20 11:23:50 +0200 |
| commit | 00e400221479ce0236640f750177309097cb622b (patch) | |
| tree | a0c0b05c088a516f5f6a7b29817b4a8cc484f087 /ishtar_common/static/js | |
| parent | daf76f988a5327cc9ed6c9dbceb3c6886a75e93a (diff) | |
| download | Ishtar-00e400221479ce0236640f750177309097cb622b.tar.bz2 Ishtar-00e400221479ce0236640f750177309097cb622b.zip | |
🐛 force referrerPolicy for OpenStreetMap tile access
Diffstat (limited to 'ishtar_common/static/js')
| -rw-r--r-- | ishtar_common/static/js/ishtar-map.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ishtar_common/static/js/ishtar-map.js b/ishtar_common/static/js/ishtar-map.js index 46a31c28e..b28f5fe0e 100644 --- a/ishtar_common/static/js/ishtar-map.js +++ b/ishtar_common/static/js/ishtar-map.js @@ -192,7 +192,17 @@ var TrackPositionControl = (function (Control) { /* base layers */ var source_osm = function(options){ - options["source"] = new ol.source.OSM(); + options["source"] = new ol.source.OSM({ + // remove in when switching to OL>= 10.6.1 -> new ol.source.OSM() + tileLoadFunction: (imageTile, src) => { + const img = imageTile.getImage(); + // Set the per-image referrer policy before assigning the src + if (img && 'referrerPolicy' in img) { + img.referrerPolicy = 'origin-when-cross-origin'; + } + img.src = src; + } + }); return new ol.layer.Tile(options); }; |
