Closed gioman closed 7 years ago
the layer is defined like this
var overlayLayers = [new ol.layer.Tile({ type: 'base-overlay', title: 'Hydda roads and labels', source: new ol.source.XYZ({ crossOrigin:'anonymous', url: 'http://s.tile.openstreetmap.se/hydda/roads_and_labels/{z}/{x}/{y}.png' }), projection: 'EPSG:3857' })
Notice the crossOrigin:'anonymous',
However, in the console I see this:
Access to Image at 'http://s.tile.openstreetmap.se/hydda/roads_and_labels/3/5/3.png' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
@bartvde, any idea?
Looks like it is not considering that declared origin
it looks like those tiles don't allow for CORS?
yeah see here:
so @volaya we should probably check which ones have CORS headers and only add crossOrigin: 'anonymous' for those definitions
It probably means those layers cannot be used for printing. That might require some docs.
ok, so i should remove the crossOrigin anonimous property, and tell @aneto to document that, right?
for all tile providers that do not have CORS headers, yes
this should be fixed now
All the others... blank result.