OfflineMaps icon indicating copy to clipboard operation
OfflineMaps copied to clipboard

Windows Phones + base64

Open osro opened this issue 9 years ago • 0 comments

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

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

osro avatar Oct 05 '15 09:10 osro