diff --git a/lib/tiles/offlineTilesEnabler.js b/lib/tiles/offlineTilesEnabler.js index e248bd8..1635ac3 100644 --- a/lib/tiles/offlineTilesEnabler.js +++ b/lib/tiles/offlineTilesEnabler.js @@ -32,7 +32,8 @@ define([ { console.log("extending layer", layer.url); - layer._lastTileUrl = ""; + layer._lastTileUrl = ""; + layer._imageType = ""; /* we add some methods to the layer object */ /* we don't want to extend the tiled layer class, as it is a capability that we want to add only to one instance */ @@ -76,6 +77,7 @@ define([ console.log("LIBRARY ONLINE " + this.offline.online) if( this.offline.online ) { + if(layer._imageType == "")layer._imageType = this.tileInfo.format.toLowerCase(); console.log("fetching url online: ", url); layer._lastTileUrl = url; return url; @@ -99,7 +101,7 @@ console.log("LIBRARY ONLINE " + this.offline.online) { img.style.borderColor = "blue"; console.log("found tile offline", url); - imgURL = "data:image;base64," + offlineTile.img; + imgURL = "data:image/" + layer._imageType +";base64," + offlineTile.img; } else {