I'm trying to make an Android application that lets you download map tiles for a particular bounding box (multiple zoom levels) and use them when the device isn't connected to network.
I'm using OSMDroid as the maps library. These are the things that I have tried -
Cache Manager - Using this takes a very long time to download map data for even a small bounding box and one zoom level. Sample code -
CacheManager cacheManager = new CacheManager(map); cacheManager.downloadAreaAsync(this, new BoundingBox(85, 21, 84, 20), 15, 15);
- Mapsforge - I found a couple of sample projects using Mapsforge to download map tiles for offline use. But that didn't help me either.
- MOBAC - Couldn't find anything concrete.
I want to be able to download map data and load those tiles in offline mode. Also, there are lot of legal issues related to using certain map sources.
- What are the map sources that we can use without worrying about legal issues?
- How can I download base map data and any overlay layers(kml, geojson, wms, etc) for a particular bounding box?
- What are the best Open Source libraries for Offline Maps?
Thanks!!
UPDATE :
So, I've used MapProxy to cache tiles for a BBox and zoom levels. I'm trying to use osmdroid to render these tiles.
I've stored these png tiles in (/sdcard/osmdroid/tiles). The documentation says something about storing it as cache.db. The set of tiles I have cached are png images. How do I store them in the required format?
Secondly, how can I set the Tile Source to use these offline tiles?
Thanks again!