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

Windows Phones + base64 #1

Open
osro opened this issue Oct 5, 2015 · 0 comments
Open

Windows Phones + base64 #1

osro opened this issue Oct 5, 2015 · 0 comments

Comments

@osro
Copy link

osro commented Oct 5, 2015

Just wanted to share this if someone else is struggling with the issue 😄

Seems like the Internet Explorer on Windows Phones doesn't like raw binary images, so I fixed this by converting the uint8array to base64 string in the getTileUrl function like this:

function (tx, res) {                
  var u8 = new Uint8Array(res.rows.item(0).tile_data);
  var b64encoded = btoa(String.fromCharCode.apply(null, u8)); 
  tile.src = base64Prefix + b64encoded;
}
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