New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How should I use user-supplied maps? #1950
Comments
hmm i haven't kept up with the ever changing android apis. might want to check with the maps force folks to see if they have alternate apis that we could potentially wire in an input stream instead of file. |
Hi @spyhunter99
As far as I can see the constructor for osmdroid's MapsForgeTileSource takes File[] and uses it internally to create Mapsforge MapFiles. Mapfile also has a constructor that accepts a FileInputStream My suggestion would be: MapsForgeTileSource should be able to accept FileInputStream[]. In my scenario this would work: You can create a MapFile from a DocumentFile. I tested that in my app. (The Android ContentResolver only lets me open an InputStream, but that can be casted to FileInputsStream, since the InputStream comes from a file.) If implemented MapsForgeTileSource would work with the Android Storage Access Framework. |
Perhaps the MapsForge API implementator could use the GeoPackage API as a basis since it already has methods with DocumentFile. #1743 (comment) |
Issue Type
[x] Question
Description
I am the developer of Trackbook, a small app that records hikes. The app uses osmdroid. I recently got the request to add offline maps.
My approach:
My problem: The files/directories, that the app receives from the system file picker, are of the type DocumentFile. MapsForgeTileSource only works with File.
I know that there is a (closed) issue #1591 for this problem. So my question rather would be:
Did I choose the right approach, given the premise, that I want to use user-supplied maps?
The text was updated successfully, but these errors were encountered: