I have it, at first time I used the example of Scott (
https://github.com/stdavis/OfflineMbTiles) modifying the query:
getTileUrl: function (tilePoint, zoom, tile) {
var z = this._getOffsetZoom (zoom);
var x = tilePoint.x;
var y = tilePoint.y;
base64Prefix var = 'data: image / png; base64,';
basedatos.transaction (queryDB, errorCB);
queryDB function (tx) {
tx.executeSql ('SELECT lower (quote (tile_data)) FROM INNER JOIN images ON map = map.tile_id WHERE images.tile_id zoom_level =? AND tile_column =? AND tile_row =?', [z, x, y], querySuccess, errorCB);
}
querySuccess function (tx, results) {
if (! results.rowsAffected) {
console.log ('No rows affected!');
/ / return false;
}
console.log ('data ************>' + results.tile_data);
/ / + results.rows.item base64Prefix tile.src = (0). tile_data;
/ / tile.src base64Prefix + = results;
tile.src = results;
}
errorCB function (err) {
console.log ("Error processing SQL:" + err.code);
}
},
_loadTile: function (tile, tilePoint, zoom) {
tile._layer = this;
tile.onload = this._tileOnLoad;
tile.onerror = this._tileOnError;
this.getTileUrl (tilePoint, zoom, tile);
}
But I received the next error:
android.database.sqlite.SQLiteException: unknown error: Unable to convert BLOB to stringSounds like you are missing the base64 encoding, but I could not get it.
But I found the following code which I worked!
https://gist.github.com/adube/5041097