Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
simo78 opened this issue Feb 25, 2014 · 1 comment

Comments

@simo78
Copy link

simo78 commented Feb 25, 2014

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
Copy link
Owner

Zverik commented Mar 11, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants