2

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 -

  1. 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);
    
  2. Mapsforge - I found a couple of sample projects using Mapsforge to download map tiles for offline use. But that didn't help me either.
  3. 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.

  1. What are the map sources that we can use without worrying about legal issues?
  2. How can I download base map data and any overlay layers(kml, geojson, wms, etc) for a particular bounding box?
  3. 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!

Arjun Issar
  • 672
  • 4
  • 13
  • 32
  • 1
    You have to setup your own server where the app can download the offline stuff from generated with MOBAC. As far as i know the download servers of openstreetmap and mapsforge only allow small traffic – k3b Jul 23 '19 at 07:42

0 Answers0