How to use OSM map in an android application.? Is there any tutorial to learn about using OSM in android.?

后端 未结 5 681
后悔当初
后悔当初 2021-01-31 11:06

I am searching for a tutorial/manual or steps to include Open street map into my android application. All I found is either a big project with lot more functionality on it, othe

5条回答
  •  渐次进展
    2021-01-31 11:54

    This OSMdroid sample project is definitely the simplest that i have come across. No more than 5 minutes to be up and running. Pay attention to the manifest file.

    For a bit more complexity, this tutorial displays a map with a current geopoint.

    Here are some snippets from various projects. Haven't tested all of them, though.

    You should download OSMdroid and SLF4J, place in libs folder, Add as Library osmdroid, fix AndroidManifest.xml with proper permissions (see first tutorial). If you do this, there is no need to alter gradle.build file as recommended in first tutorial.

    I recommend that you use, for starters, the older versions of osmdroid (3.x) when using these. Once you are comfortable, migrate to newer version of osmdroid (4.x or 5.x).

    GeoPoint and MapController classes change names in newer versions, so watch out for INCOMPATIBLE TYPES ERROR

    IGeoPoint cannot be converted to GeoPoint

    IMapController cannot be converted to MapController

提交回复
热议问题