I am working on an extension to OpenLayers to pre-cache tiles in a local Web SQL datastore to support mapping on mobile device when connectivity is dead.
I would like to pre-seed my cache with a set of tiles. Currently this has to be done by visiting the area in question and using the cacheWrite control.
This would be done by fetching the tiles in question from my MapServer WMS and storing them locally in the Web SQL database. These would then be available for the cacheRead control to use on tileerror.
So, my question is: given a bounding box, is there an easy way for me to construct these calls using OpenLayers and hence populate the cache with the required tiles for a required zoom level?
A sample single tile call is:-
I can do this by panning the map about automatically, but the user experience is terrible ;-)