Open JJones780 opened 11 years ago
I see that another, more flexible cache solution is being added at the moment. Please let me know if this more limited solution would be beneficial as well - it might be simpler? In the meantime I'll look into making a pull-request etc..
Feature Description
Allow a webpage to serve map tiles from it's baseURL ( for important, modified or high-use tiles ) while loading all other tiles from a regular tile server. This is different from a cache in that the tiles are still obtained from a server in either case.
For a phonegap application the tiles would be part of the downloaded package thus cutting down on tile server load. This use is similar to a cache except that it is pre-loaded and very straightforward to setup and use.
Implementation:
No changes to existing code. It is an entirely separate control.
Use
Add it to a map in two lines! load the definition file ( which defines the localtiles object describing which tiles are available) :
<script type="text/javascript" src="tiles/localtiles.js"></script>
and later add the control to the map:
map.addControl( new OpenLayers.Control.LocalRead(localtiles, 'tiles/') );
It would be nice to have this work with a cache as well, which is possible but I've not tested this use. I generate the definition file automatically with a unix perl script looking at the tile directory.
External Tools
You need a separate tool to make it easy to download the tiles into the proper file structure. I used jTileDownloader.