offline caching

22 views
Skip to first unread message

mdavis

unread,
Feb 20, 2012, 10:11:32 AM2/20/12
to Tile5, csom...@brwncald.com
We are interested in developing a mobile app that uses Tile5. The app
will work in a disconnected state most of the time. Is it possible to
cache the image tiles to the mobile device (either as files or in a
sqlite database) and access them with Tile5? If so, can you please
provide some guidance or sample code on how to get started?

Damon Oehlman

unread,
Feb 20, 2012, 6:12:47 PM2/20/12
to ti...@googlegroups.com, csom...@brwncald.com
Hey Matthew,

If you are hosting the tiles yourself then it's absolutely possible.  You do run into problems however if you are using images from another domain though as most techniques for caching images locally require operations that are prevented from working across domains due to security policy.

The technique you will use will vary depending on how you wish to deploy your application.  Are you thinking about using a PhoneGap wrapper?  If so, would you like to provide a sqlite database of tile images with the app in case the application is used offline in the first instance?

The good news is that whatever technique is implemented, it will be compatible with other mapping libraries like LeafletJS (http://leaflet.cloudmade.com/) in addition to Tile5.  I say this because I've definitely pulled back a bit on Tile5 development, and  the Leaflet team are doing amazing work.   If there are features about Tile5 that you really do like though, please let me know as it's definitely something I will continue to work on if it does offer a genuine point of difference.

Let's keep this conversation going and based on your needs, I'll put together a blog post on how to achieve what you are after :)

Cheers,
Damon.
--
Damon Oehlman
http://distractable.net/

Damon Oehlman

unread,
Feb 21, 2012, 5:30:03 PM2/21/12
to ti...@googlegroups.com
Just as a quick follow up to this, I was pointed to this excellent article from Mozilla that covers some of the fundamentals of storing images in localStorage:


Cheers,
Damon.
Reply all
Reply to author
Forward
0 new messages