In our mobile application, we'd like to use the map offline.
Actually, we don't care about tiles, but we want the user to be able to see some Vector layers. Here is a piece of code:
layer = new OpenLayers.Layer.Vector("Block", {
strategies: [new OpenLayers.Strategy.BBOX()],
filter: VMMS.GIS.GetBlockFilter(i),
protocol: new OpenLayers.Protocol.WFS({
url: self.urlProxyGeoserver,
version: "1.1.0",
featureType: "block",
featureNS: self.urlGeoserver + self.dataStore,
featurePrefix: self.dataStore,
srsName: "EPSG:900913",
geometryName: "block_geom",
schema: self.urlGeoserver + "wfs/DescribeFeatureType?version=1.1.0&typename=" + self.dataStore + ":block"
}),
projection: "EPSG:900913",
styleMap : self.StyleBlockWithOpacity
});
I would like to be able to load this layer before to be offline, then use it. I tried to do it, and cache it with localstorage (HTML5), but some problems occurs because of javascript cyclic object.
I could make the request (with url parameter) with my own API, and then cache the response. But I have the feeling that we have to use OpenLayers API.
Otherwise, do you have any idea?
On google, I have only seen solution to cache tiles, but not about my problem. I'm kind of newbie to Openlayers, so I might have miss something. In that case, I would be happy to know what :)
Thanks
Edit: By the way, I tried the recommandation there: WFS Caching / Back button But it's not working (or doesn't match with my needs for some)