Zverik / leaflet-grayscale

Grayscale TileLayer for Leaflet
105 stars 37 forks source link

Chrome: "cross-origin image load denied by cross-origin resource sharing policy" when tilelayer from local disk #4

Open simo78 opened 10 years ago

simo78 commented 10 years ago

Using an up-to-date version of Chrome (Version 33.0.1750.117, Mac OS X), I get this error message (repeated 38 times or so...):

"cross-origin image load denied by cross-origin resource sharing policy"

Map tiles are on local disk - therefore I do not understand the root cause of this error message. I am calling leaflet-grayscale with thie method:

var taustakartta = new L.tileLayer.grayscale('taustakartta/{z}/{x}/{y}.png', {
  attribution: 'Kartta: Maanmittauslaitos',
  maxZoom: 20,
  opacity: 0.65
});

I think the problem is caused by leaflet-grayscale. If I remove it and use normal L.TileLayer method, then everything works perfectly also in Chrome:

var taustakartta = new L.TileLayer('taustakartta/{z}/{x}/{y}.png', {
  attribution: 'Kartta: Maanmittauslaitos',
  maxZoom: 20,
  opacity: 0.65
});
Zverik commented 10 years ago

I doubt I can fix that: https://code.google.com/p/chromium/issues/detail?id=238810 You can also try starting Chrome with --allow-file-access-from-files command line parameter.