gregallensworth / L.TileLayer.Cordova

Leaflet TileLayer subclass which caches to local filesystem, for Cordova/Phonegap
MIT License
87 stars 25 forks source link

can we pre populate with certain area map and distribute along with map #8

Closed Alphatiger closed 8 years ago

Alphatiger commented 9 years ago

We are trying to serve maps offline

Two options

1) pre populate with required png's 2) file transfer required maps as one single file do further procsessing and serve maps

gregallensworth commented 8 years ago

This would be beyond the scope of L.TileLayer.Cordova, and would be application code and app distribution questions.

If you can pre-generate every PNG and bundle it into your Cordova app's www/ folder, then you wouldn't need L.TileLayer.Cordova at all. Simply configure your L.TileLayer to load from www/tiles/{z}/{x}/{y}/png and there would be no need for network access at all. This would mean a large app download, but very good performance and no network access.

Downloading a ZIP file and unpacking it into an application folder, would be beyond the scope of L.TileLayer.Cordova. But offhand, I'd say that if the app unpacks the ZIP under the tiles folder, and if the tiles are named with the same convention, this should work.