correctly detect tile image type

This commit is contained in:
Andy Gup 2014-06-04 17:32:50 -06:00
parent 48e314a072
commit 4e2e0a3994

View File

@ -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
{