问题
I'm trying to build an offline map on android and I'm still a beginner in that. so I added osmdroid to my project and I downloaded a the map data from this link. after some searching in the internet I still didn't find an example to display the data. In addition osmdroid use sd card location from what I found. is there a possibility to change that with a clear example about how to do it ?
thank you
回答1:
You downloaded raw openstreetmap data. Osmdroid requires rendered tiles for offline functionality.
So you have two problems:
1) How to get rendered tiles. 2) How to integrate them into the application for offline usage.
Osmdroid has quite good documentation about offline maps and it is quite complex topic which cannot be covered in one proper Stackoverflow answer. You'll need to go through osmdroid wiki article Offline-Map-Tiles where are covered both your problems (and even your question about file location).
There are other wiki topics you schuld check.
- https://github.com/osmdroid/osmdroid/wiki/Map-Sources
- https://github.com/osmdroid/osmdroid/wiki/Modular-Tile-Provider-Architecture
来源:https://stackoverflow.com/questions/45792284/osm-offline-on-android