[OpenLayers-Users] Re: caching tiles with phonegap

Steve Nelson snelson at webapper.com
Mon Apr 16 09:36:49 EDT 2012


I didn't see this message. That looks exactly like what i'm looking for.

What the heck is window.plugins.fileDownload? I've never seen that before.

Also, I did a search through OpenLayers.js and it found 17
getURL:function(bounds) can you point me in the right direction with which
one you modified? If not, I'll just use trial and error to figure it out.
Thanks Tue!

Steve

On Fri, Mar 23, 2012 at 9:56 AM, Tue Topholm <tt at sugee.dk> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120416/1994f5ed/attachment.html


More information about the Users mailing list