I am a newbie to Open Street Map. I made some research and found that we can download and store the map into a folder. But i didn't find any tutorial or sample that provides offline Open Street Map. Can someone provide a step by step tutorial, a guide to implement offline open street map please. I am following this example http://android-coding.blogspot.com/2012/06/example-of-implementing-openstreetmap.html but now i want to make it available when there is no connection.
3 Answers
Like in the tutorial you mentionned you can use osmdroid library: https://code.google.com/p/osmdroid/
There's a good explanation of how osmdroid works with offline maps here: https://stackoverflow.com/a/8286276/891479
Use MapTileProviderBasic in your app. Some examples here: http://www.androidadb.com/class/ma/MapTileProviderBasic.html
To generate your offline maps in osmdroid format use Mobile Atlas Creator: http://mobac.sourceforge.net/
You can choose the source of the maps and the output format. Once generated, put your maps atlas in zip format into your "/osmdroid/map" directory.
Hope it will help!
- 
                    Hi @resus,... i just found out that Google Earth / Maps options have been removed from the Mobile Atlas Creator functions? If that's the case... how could I create the map of my area that supported to be read by osmdroid? – gumuruh Aug 09 '14 at 06:47
 - 
                    Google maps are probably not present for licensing reason, you can use openstreet maps sources for offline maps. – L. G. Aug 11 '14 at 08:45
 
I have found this tutorial that explains all things you need step by step.
In brief:
1- You must download map tiles using Mobile Atlas Creator. I have explained the steps HERE
2- Move the resulting zip-file to /mnt/sdcard/osmdroid/ on your device.
3- Adding osmdroid-android-XXX.jar and slf4j-android-1.5.8.jar into build path your project
4- Adding MapView: You can add a MapView to your xml layout
<org.osmdroid.views.MapView
    android:id="@+id/mapview"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tilesource="Mapnik"
    />
Or create a MapView programmatically:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
    mResourceProxy = new ResourceProxyImpl(inflater.getContext().getApplicationContext());
    mMapView = new MapView(inflater.getContext(), 256, mResourceProxy);
    return mMapView;
}
Hope it Helps ;)
- 1
 - 1
 
- 9,113
 - 13
 - 65
 - 78