4

I am using offline version of osmdroid, maps are placed in sdcard/osmdroid. Do you know, how to change the file path? I have been searching through their code for handling ZIP files but I haven't found any solution. Anyone faced this issue before?

Thx

Waypoint
  • 17,283
  • 39
  • 116
  • 170
  • 4
    http://code.google.com/p/osmdroid/source/browse/trunk/osmdroid-android/src/main/java/org/osmdroid/tileprovider/constants/OpenStreetMapTileProviderConstants.java – Blackbelt Mar 05 '12 at 14:17
  • @blackbelt - that looks spot on. static and final in an interface, so unless you build your own version from source, you're stuck with what's there. – NickT Mar 05 '12 at 14:22
  • thanks, now I will need to change it. And do you know blackbelt, where in osmdroid are handling unzipping ZIP files? Make it a reply then, I will give you a reputation points. Thx – Waypoint Mar 05 '12 at 14:24
  • NickT - oh, thats bad... I don't think it is available for download as a cource to build on your own... – Waypoint Mar 05 '12 at 14:25
  • @Waypoint - Yes, you can get a copy of the source, I've not done it myself, but if you use subversion it's available at http://code.google.com/p/osmdroid/source/checkout – NickT Mar 05 '12 at 14:34
  • svn checkout http://osmdroid.googlecode.com/svn/trunk/ osmdroid-read-only . use svn to checkout the osmdroid source code – Blackbelt Mar 05 '12 at 14:44

2 Answers2

4

If you download the package of code about osmdroid: osmdroid-android-3.0.8-sources, you can open the class OpenStreetMapTileProviderConstants.java and modify the variable in this way:

modify

public static final File OSMDROID_PATH = new File("/mnt/sdcard/osmdroid");

to*

public static final File OSMDROID_PATH = new File("/mnt/ext_sdcard/yourfile");

Then put your map tiles into yourfile.

biegleux
  • 13,179
  • 11
  • 45
  • 52
Gallery
  • 268
  • 4
  • 14
2

Here you can check out the code to build your own version of OSMdroid. Changing ZIP and local folder is totally possbile, had to do it myself a few months ago.

Responsible for the Zips are this classes:

org/osmdroid/tileprovider/modules/ZipFileArchive.java
org/osmdroid/tileprovider/modules/MapTileFileArchiveProvider.java
Thommy
  • 5,070
  • 2
  • 28
  • 51
  • thanks Thommy, I am using eclipse and I don't see here any svn bridge solution? Do I need to install some plugin to be able to check out OSMdroid source code? – Waypoint Mar 05 '12 at 14:36
  • 2
    You can do the checkout with you preferred svn tool. Eclipse plugin or standalone tool - that doesn't matter. You just need to delete all .svn Folders in the project after checkout. – Thommy Mar 05 '12 at 14:39