2

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.

Stepan Mazokha
  • 459
  • 1
  • 5
  • 22

2 Answers2

5

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.

Stepan Mazokha
  • 459
  • 1
  • 5
  • 22
  • 1
    Also maps.me was opensourced, but you'll need some skills to cut rendering engine and paste it into your app. – dkiselev May 14 '17 at 14:57
1

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.

Community
  • 1
  • 1
dkiselev
  • 890
  • 8
  • 20
  • thank you for the answer. i will definitely use vector tiles because of their less memory consumption. but are there any good tutorials about all of this? because when I looked at OSMAnd github repo, i understood that i need to learn how to deal with work with maps. – Stepan Mazokha Jul 17 '15 at 16:56
  • are there any free vector renderers? or maybe it is possible to use Mapbox renderer for free (not the data they offer, but just the rendering engine)? because as i can see, getyourmap doesn't actually show their renderer code.. – Stepan Mazokha Jul 17 '15 at 17:21
  • OSMAnd uses `OSMAnd Map Creator` to encode osm data into protobuffer tiles. And it's not easy at all to deal with OSMAnd as a rendreing library. May be creating a plugin for OSMAnd would be an option for you. `GetYourMaps` have a free option but it's still closed source. Sorry there is no easy way here. MapBox GL, as I know, uses Node.js for backend and js for client side rendering. So it maybe even more complicated to turn it into Android rendering lib than the same trick with OSMAnd. And one more option, which I have forgotten. https://github.com/saintbyte/mapsforge (see answer body) – dkiselev Jul 20 '15 at 07:30
  • I found a majestic solution! It's called mapzen and its project called Open. This is an android app, which uses OpenScinceMap for rendering. All the code is on github. And this is probably the best open source solution ever found. – Stepan Mazokha Jul 20 '15 at 12:37