简体   繁体   中英

Offline maps OSM

I am a bit stuck with an idea of offline maps in android application.

I want to use Open Street Maps. But how can I redesign their styles and then use in my project? By the way, the resource, I am looking for, has to be free..

Are there any good tutorials about this? I am new to this, so would be thankful for any helpful information.

Here are the basics:

Raster tiles are awful . To my mind, this approach of mobile mapping is very old-fashioned and has no advantages (unless your plan is to make a very bad-looking application).

The other thing is vector tiles . All the data is saved in much more efficient way and can be displayed very beautifully.

And the solutions (nominees) are:

  1. Mapsforge - thanks to @dkiselev
  2. OSMAnd app - thanks to @dkiselev
  3. Mapbox GL (the android version has no releases now, but they are working really hard on it). If you really like mapbox, you can think about Mapbox Android SDK, which uses raster tiles, but I believe, that switching to Mapbox GL will not be that hard, when the GL lib will be released.
  4. AirBNB AirMapView - open source and has release version
  5. Urban Labs Sputnik Demo - also interesting solution, but I didn't use it.
  6. Mapzen Open - open source android app, that uses all the best from everywhere. - winner!

And by the way, mapbox gl actully allows rendering your own mapping data (from your own provider). There is a closed issue on github about that, opened by me couple of days ago, and very good answer by one of the project developers.

If you don't care about using your own data source and want to rapidly implement custom (not google/apple) maps into your project - there are dozens of solutions for you as well. You could think of Mapbox , Scobbler , GetYourMap or, again, just google it to find more. There is actually a great article on OSM website about most popular libraries and apps for android ever developed.

Finally, I wish you good luck with your mapping project. And never forget:

if you can't find something doesn't mean it really doesn't exist - probably you've just been searching not enough.

Offline raster tiles cache

If you need to show your map offline with custom style, you may use any kind of OSM renders. http://wiki.openstreetmap.org/wiki/Rendering

For the case of several cities, I would recommend you http://wiki.openstreetmap.org/wiki/AlaCarte or http://wiki.openstreetmap.org/wiki/TileMill

Create your own style, and export map tiles to sqlite db archive.

After that, you will need to create your own TileProvider for OSMDroid library. This answer could help you How to use MOBAC created OSMDroid SQLite tile source file offline?

Offline vector tiles.

Getyourmap

If you need more than just rendering with custom style, you may use: https://getyourmap.com/ it's OSM vector renderer. But there would be some problems with accessing raw data to create routing and searching.

OSMAnd

And maybe the hardest but the best way, is to use OSMAnd. It's open-source, there are lots of capabilities, but it's an application, not a component or library.

So if you want to create a stand alone app. you will need to cut off features which you don't need.

Mapsforge

https://github.com/saintbyte/mapsforge It's opensource so it would be possible to add routing and searching. Style, as I know may be customized, but I haven't try it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM