[OpenLayers-Users] Offline Storage Help

Andreas Hocevar ahocevar at boundlessgeo.com
Thu Jan 16 12:20:29 PST 2014


Hi,

the CacheRead and CacheWrite controls use Local Storage, so your tiles even
persist after closing the browser, restarting your device, etc.

If they don't, then maybe you have configured something in a wrong way.
Have you looked at
http://openlayers.org/dev/examples/offline-storage.htmland made sure
that your app configures the controls in a similar way? Also
be aware, as already discussed, that you either need a server that sends
CORS headers, or a proxy to work around the same origin restriction.

Andreas.


On Thu, Jan 16, 2014 at 6:16 PM, ANC <anajera at bicimapas.com.mx> wrote:

> Thanks for the information Andreas.
>
> Continuing with this topic, in order to have a full offline option, I have
> added a manifest file to load the full page and openlayers functionality to
> be cached.  I then, while being online,  load the page, cache the tiles for
> the area of interest and then go offline. The cached tiles show as
> expected.
> But if, while being offline and to test whether the tiles remain available
> between sessions, I do a refresh or open the page in a new window after
> closing the original session , the Openlayers UI shows properly (the
> manifest file is working) but the tiles do not show anymore. I am looking
> to
> keep the tiles between sessions.
>
> Looking at the HTML5 documentation, Web storage, which I understand is what
> these functions are using,  has 2 options:
>
> localStorage - stores data with no expiration date and sessionStorage -
> stores data for one session
>
> The question being, are the cacheWrite/cacheRead functions based on
> sessionStorage, that is cached files are stored just fot the active
> session?
> Is there a way to preserve the cached tiles between sessions? I have tested
> with both "tileerror" and "tileloadstart" fetchEvents in cacheRead but it
> seems to make no difference.
>
> Thank you
>
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Offline-Storage-Help-tp5096401p5098461.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> 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/20140116/e32ba34e/attachment.html>


More information about the Users mailing list