planetfederal / qgis-webappbuilder-plugin

GNU General Public License v3.0
18 stars 20 forks source link

overlay maps: the only ones that show somthing are the one "stamen" #375

Closed gioman closed 7 years ago

gioman commented 7 years ago

All the others... blank result.

volaya commented 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?

volaya commented 7 years ago

Looks like it is not considering that declared origin

bartvde commented 7 years ago

it looks like those tiles don't allow for CORS?

bartvde commented 7 years ago

yeah see here: selection_270

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.

volaya commented 7 years ago

ok, so i should remove the crossOrigin anonimous property, and tell @aneto to document that, right?

bartvde commented 7 years ago

for all tile providers that do not have CORS headers, yes

volaya commented 7 years ago

this should be fixed now