Android Question Custom, local tiles with OSMDroid

zava

Member
Hello,
I am investigating the possibility of using the OSMDroid wrap for a simple app, although it seems frozen at V4 while the original has moved to V6 (my main purpose is to remain in the B4X environment vs. the Android Studio mess...)

I therefore need to understand if/how OsmDroid could use tiles or files created from digitized/georeferenced images (scans from historical maps). I Understand they may be produced with MapTiler or similar tool and used in place of downloaded/cached tiles.

  • Can OsmDroid load such tiles?
  • What files should be produced and where should they be stored?
  • How should they be loaded?
It appears that original OsmDroid V6 can do this, but I haven't been able to locate this for the B4X wrap which seems to only use downloaded or cached tyles.

Thank you for any help!
 

TILogistic

Expert
Licensed User
Longtime User
I have seen your questions in the forum and what you want to do.

I suggest you check out the B4Xmap class.

this class uses the tiles that it downloads to a database (SQLlite) simulating the cache.

Review it and adapt it to your needs.


1642767504954.png



note:
.B4Xlib is Zip
 
Last edited:
Upvote 0

zava

Member
Thank you @oparra
I had seen that thread and library, but as far as I can understand (not much, unfortunately...) it appeared that B4XPages could store tiles that it had previously downloaded and cahe them.
What I need instead is to get MY maps/tiles to be displayed, not maps that were previously downloaded.
I have images from maps that I can georeference and convert to tiles (MapTiler or similar), but they don't come from a server: I must place the file somewhere B4XPage lib can access and display/navigate.

Are you implying that it is possible for B4XPages to somewhat incorporate a local set of tiles and then make it available "as if" it was in the cache?
I haven't seen this in the lib description (but I may easily have missed it...)

Thank you!
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
Estimated.
You can adapt the class and display your tiles.

There are other solutions on the forum.

This forum member did something similar.

See:
etc.
 
Upvote 0

zava

Member
Thank you once more @oparra for these suggestions.
Unfortunately, I am not competent enough to dive into taking bits of cofe from disparate libraries, even from other platforms such as J, and adapt them.
MapAx may be a good solution, but developer did not share his source code, so it cannot be instructive to me.
My only chance is to find a dedicated, stable, comprehensive library that does (most of) the job...
B4XMaps does most of the job but doesn't appear to be able to load offline/custom tiles unless cached ones.
OSMDroid might be such a library, but is seems difficult to know if
  • Can OsmDroid load offline tiles?
  • What tile files should be produced and where should they be stored?
  • How should they be loaded?
It seems that original OSMDroid 6.x does all this but it's not available in B4X platform, while it is not known (to me) if the older (and apparently abandoned) OsmDroid 4.x wrapped for B4X can do it.
Of course I could go back to Android Studio and use OSMDroid 6.x, but B4X seems much more user friendly to me...

Thank you for your continued help!
 
Upvote 0
Top