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

Cross-domain Canvas limitations: add try/catch and document it #5

Closed
gregallensworth opened this issue May 17, 2016 · 1 comment
Closed

Comments

@gregallensworth
Copy link
Member

Note that Canvas does have cross-domain issues much as does AJAX. Loading tiles from a remote origin will not work properly unless CORS headers are set.

  • Add try/catch to PixelFilter.js at that getImageData() around line 99, so it gives a more useful error message
  • Document this in the README so it's pretty clear, cuz folks likely don't know offhand
@gregallensworth
Copy link
Member Author

This round of commits greatly improves the cross-origin situation:

  • Documented it and gave links to other places to learn about CORS
  • Extended the _createTile() function to add the .crossDomain="Anonymous" attribute, so the tile is "CORS ready" if headers are available.
  • Added exception handling around getImageData() so that if it does fail, a more useful error message is given.

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

1 participant