Saving offline map atlas inside osmdroid

223 Views Asked by At

Is there a solution to save the map tiles inside the app like the Mobile Atlas Creator works on the desktop?

I only found a way by using PC application.

1

There are 1 best solutions below

0
On

There sure is. It probably needs some more testing, but the example is located here:

https://github.com/osmdroid/osmdroid/blob/master/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/cache/SampleCacheDownloaderArchive.java

Essentially, when you fire up an instance of CacheManager, it gets the map view's IFileSystemCache instance, which is normally the Sqlite tile cache (the kind that expires). This example feeds in an alternate implementation that produces a permanent sql tile archive (no expiration dates in it).

Use it with caution has many tile sources do not allow you to do this in their terms of service and you can get banned for doing so

Edit: there's more info the wiki https://github.com/osmdroid/osmdroid/wiki/Offline-Map-Tiles#use-osmdroids-cache-manager-on-device---version-52