This project provides zip files of Tiles based on bbox Values. These files can be rendered in Native Android Application Using OSMDroid. We need to use gradle version less than 5.5 to build the project.
Caching tiles for offline/disconnect use
Any map source (baring legal issues) that uses the Z/X/Y tile naming convention.
Osmdroid style zip, sqlite and GEMFile databases. Copy the output file to /sdcard/osmdroid/. Then use Osmdroid to render.
1.After building the project with gradle version less than 5.5 2.Navigate to build/libs/ 3.Open a command line/terminal/bash shell
java -jar osmdroid-packager-<VERSION>-jar-with-dependencies.jar -u url -ismap false -t <MapSourceName> -d <outputfile.zip> -zmin <MIN ZOOM> -zmax <MAX ZOOM up to 22> -n <NORTH> -s <SOUTH> -e <EAST> -w <WEST> -nthreads <optional, number of current threads, default 2> -fa <optional file extension add on, not really needed>1
All bounds are in decimal degrees latitude/longitude.
Here's a few usage examples. There's a few caveats that you must follow if you want these tiles to show up in OsmDroid.
- The temporary folder to save files should be named the name of your map source.
- In OsmDroid, set the map source's name equal to the temporary folder name.
java -jar ....-jar -t <name of map source here> -d outputfile
Example: Open Streem Map tiles (Mapnik)
java -jar ....jar -u http://b.tile.openstreetmap.org/%d/%d/%d.png -t Mapnik -d at_mapnik_13.zip -zmax 13 -n 49.03942 -s 46.40162 -e 17.14736 -w 9.44595
^ that's the important part!
https://github.com/osmdroid/osmdroid/wiki/Offline-Map-Tiles
https://github.com/osmdroid/osmdroid/wiki/Map-Sources