Hi,<div><br></div><div>We are trying to develop a mobile application using PhoneGap and OpenLayers that will allow a certain amount of offline access. For this, we wish to cache tiles to the local hard disk.</div><div><br>

</div><div>We want to do the following:</div><div><br></div><div><ol><li>Download tiles for a couple of zoom levels centered on a set of lat/lon points (e.g. 5 x 5 tiles at zoom level 2, 5 x 5 tiles at zoom level 3).</li>

<li>Store these tiles using the normal directory structure on the local disk.</li><li>Access these tiles using OpenLayers when offline.</li></ol><div>Now, as we're using PhoneGap I think the 3rd part is easy as we have access to the local hard disk. We can just point OpenLayers to the tile directory on the local disk as if it was a normal TMS. Is this correct?</div>

</div><div><br></div><div>What's really causing problems though are steps 1 and 2. I don't really understand how to convert a lat/lon into a set of tile URLs in this way! What I'd really like is a method that given a lat/lon will return an array of tile URLs. I can then use the PhoneGap file system API to save these to the local disk.</div>

<div><br></div><div>If anybody can help me get started with this it would be greatly appreciated :-)</div><div><br></div><div>Cheers,</div><div><br></div><div>Jon</div>