leaflet-grayscale icon indicating copy to clipboard operation
leaflet-grayscale copied to clipboard

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

Open simo78 opened this issue 11 years ago • 1 comments

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
});

simo78 avatar Feb 25 '14 11:02 simo78

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.

Zverik avatar Mar 11 '14 15:03 Zverik