Hey guys... I want to develop a full offline app, where the map data is included in the apk, for android (java). First I started using the mapbox sdk but unfortunately I noticed that they have a tile limitation of 6k Tiles and I couldn't figure out how to load OpenStreetMap data... Now I used the osmand sdk to make the map show up with the markers and stuff... I didn't find a clear solution for my problem: Say I have downloaded the data from https://openmaptiles.com/downloads/planet/ in .mbtiles how can I load the data from the asset folder to my device and show the map, so that someone can install the .apk and will have a full offline Map. Or is there any "how to" tutorial for building a full offline map-app... I also checked mapsforge but how I figured out, they focus more on rendering than on pre-loaded data or do I miss something there? SO: 1. Tutorial to include .mbtiles or 2. Any Tutorial / tips to build full offline map... Thanks a lot. asked 09 Mar '19, 15:42 mathmike SimonPoole ♦ |
The correct answer really depends on what functionality you want to provide (which in turn tends to impact the offline data format). For simply providing an offline map, mapsforge is a tried solution. For completeness sake, https://wiki.openstreetmap.org/wiki/Frameworks#Displaying_interactive_maps is a list of relevant frameworks. answered 09 Mar '19, 19:50 SimonPoole ♦ Ok, so I definitely will work on mapsforge in that case. Right now the needed functions are: -providing offlinemap -adding markers and user location (and some marker.OnClickListener) -reverse geocoding -would be nice to provide a full street directory Is this possible with mapsforge?
(09 Mar '19, 20:41)
mathmike
1
I don't know how well it works but here is an example https://github.com/mapsforge/mapsforge/blob/c8294c7ae27b2ce4a6af56516216af8c6d7cb0b3/mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/ReverseGeocodeViewer.java
(09 Mar '19, 21:06)
SimonPoole ♦
|
I wrote about this very problem last year. You can read about the whole solution here https://medium.com/@ty2/how-to-display-offline-maps-using-maplibre-mapbox-39ad0f3c7543 and the code for the same is here https://github.com/kuwapa/OfflineMapExample/tree/83c7e81391a5f0946ab1fcb3155966c4997d44d3 Essentially, solution is
I hope this helps. Please comment any questions you might have. Happy to help. answered 16 Apr '22, 09:18 protos29 |
My knowledge here is as a user of OsmAnd not as a developer, but with that caveat in mind: While OsmAnd can show tiles it primarily stores map data as *.obf files (it's own format) and renders the map from these files. If there is no file for the area you are interested in you can create one yourself with OsmAndMapCreator. There are then different styles within the application for how these should be displayed, for custom styles see links in this section of the OsmAnd wiki page. answered 09 Mar '19, 16:21 InsertUser |