I'm working on a windows8 machine, using IIS 8 and .NET 4.5.
I've created a WCF restful service that returns a BLOB as a JSON string byte[]. On my client side i get the images and i try to read them in the following manner:
getTileUrl: function (tilePoint, zoom, tile) {
var z = this._getOffsetZoom(zoom);
var x = tilePoint.x;
var y = tilePoint.y;
var base64Prefix = 'data:image/gif;base64,';
this.mbTilesDB.transaction(function(tx) {
console.log("executing SQL!!!!");
tx.executeSql("SELECT tile_data FROM images INNER JOIN map ON images.tile_id = map.tile_id WHERE zoom_level = ? AND tile_column = ? AND tile_row = ?", [z, x, y],function(tx,result){
tile.src = base64Prefix + result.rows.item(0).tile_data; //.rows.item(0).tile_data;
}, function (er) {
console.log('error with executeSql', er);
});
});
},
I get the error message:
Failed to load resource data:image/gif;base64,137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,1,0…,237,255,1,100,245,49,110,153,90,168,241,0,0,0,0,73,69,78,68,174,66,96,130
I'm pretty sure that the item is stored in the wrong format. Ive been looking around but i can't find a clear example on how to parse a byte[] to a blob file. I'm developing on my desktop using Google chrome, but eventualy it will need to work in Phonegap.
So my question: How to i convert the byte[] to the correct BLOB format?
Thank you very much for your help