[OpenLayers-Users] Re: caching tiles with phonegap

Tue Topholm tt at sugee.dk
Fri Mar 23 09:56:27 EDT 2012


I have used this_

getURL:function(bounds)
{
var url = this.getFullRequestString({bbox:bounds.toBBOX(),height:this.tileSize.h,width:this.tileSize.w},'');

if(typeof(localStorage[filename]) != 'undefined')
{
     return localStorage[filename];
}
else
{
    window.plugins.fileDownload.downloadFile(url,'/' + sha1(url) +
'.png',function(fp){localStorage[filename] = fp},function(){});
    return url;
}
}



it was using another download plugin, so it just needs to be changed to PG's

md5 and sha1 is js functions for doing md5 and sha1
--

Med venlig hilsen / Kind regards

Tue Topholm
Sugee
Tlf: +45 32 13 32 32
W: http://www.sugee.dk



23. mar. 2012 14.49 skrev Diego Guidi <diegoguidi at gmail.com>:
>> Phonegap (a tool for creating native iphone/android apps with HTML/js) is
>> able to do it and HTML5 is able to do it also.
>>
>> http://docs.phonegap.com/en/1.5.0/phonegap_file_file.md.html#FileTransfer
> HTML5 uses localstorage, i.e 10mb space maximum available.
> PhoneGap file API doesn't suffer of this limit.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users


More information about the Users mailing list