OpenStreetMap-Tools for Android
Java XSLT Other
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
GoogleWrapperSample #794 fixes junit compile error and enables unit tests on travis Dec 2, 2017
OSMMapTilePackager #577 minor fix for windows users using the map tile packager that cau… Apr 5, 2017
OpenStreetMapViewer bug/#690 - secondary tile overlay does not refresh when tiles download May 19, 2018
config #435 part 2, settings preferences for the various configuration options Oct 21, 2016
gradle #914 prepare for release, there's some issue with the owasp plugin d… Feb 17, 2018
images Reduce aspect ratio to less than 2:1 so that image can be used on Goo… Dec 10, 2015
issues #489 update gradle fury references Dec 10, 2016
osmdroid-android-it Getting rid of class microsoft.mappoint.TileSystem May 10, 2018
osmdroid-android bug/#1040 - explicit call to invalidate after animation May 24, 2018
osmdroid-dist #553 tile server in the distro Jan 27, 2017
osmdroid-geopackage #951 appears to fix the geopackage stuff, however it has uncovered a… Feb 24, 2018
osmdroid-mapsforge Just removed `MapTile`, using `MapTileIndex` instead (#908) Feb 17, 2018
osmdroid-server-jdk #255 gradle enabling the simple tile server. this build will fail due… Dec 24, 2016
osmdroid-simple-map #936 extra simple map application Feb 17, 2018
osmdroid-third-party Just removed `MapTile`, using `MapTileIndex` instead (#908) Feb 17, 2018
osmdroid-wms #950 stricter bounds checks for the bounding box class Feb 23, 2018
src prepare for release Feb 18, 2018
.gitattributes Normalize line endings Mar 6, 2014
.gitignore #701 attempting to fix the travis ci build Sep 2, 2017
.gitmodules test commit for using git submodule for the wiki pages, thus forcing … Oct 17, 2017
.travis.yml #850 should fix resource leaks related to gemf files, offline archive… Jan 6, 2018
CHANGELOG.md #428 more javadoc content Oct 1, 2016
CONTRIBUTING.md adding contributing Oct 6, 2016
ISSUE_TEMPLATE.md NOJIRA typo Dec 2, 2017
LICENSE Initial commit Mar 6, 2014
OSMDroid_CleanUp_Settings.xml Normalize line endings Mar 6, 2014
OSMDroid_Formatter_Settings.xml Normalize line endings Mar 6, 2014
README.md Update README.md (#1021) May 1, 2018
archive.sqlite #428 more javadoc content Oct 1, 2016
build.gradle #914 prepare for release, there's some issue with the owasp plugin d… Feb 17, 2018
gradle.properties feature/#977: Downgrade Robolectric to 3.0 Apr 5, 2018
gradlew #91 adding grade build files. Note: this is only a partial solution, … Oct 19, 2015
gradlew.bat #91 adding grade build files. Note: this is only a partial solution, … Oct 19, 2015
pom.xml Merge branch 'master' into feature/#255 Oct 24, 2016
proguard_openmap.txt #633 progaurd updates per user feedback Jul 29, 2017
proguard_osm.txt #633 progaurd updates per user feedback Jul 29, 2017
proguard_osm_min.txt #381 sample proguard files Aug 28, 2016
settings.fdroid #407 updating the fdroid build script Aug 19, 2017
settings.gradle #936 extra simple map application Feb 17, 2018
testzoom4.gemf #850 should fix resource leaks related to gemf files, offline archive… Jan 6, 2018
testzoom4.sqlite #850 should fix resource leaks related to gemf files, offline archive… Jan 6, 2018
testzoom4.zip #850 should fix resource leaks related to gemf files, offline archive… Jan 6, 2018
travis.sh #321 temporarily disabling the maven build from ci until the maven-an… Jun 4, 2016
world.map #180 auto zoom to bounds of the selected tile source for both geopack… Jan 14, 2017

README.md

osmdroid Build Status Maven Central Android Arsenal

osmdroid is a (almost) full/free replacement for Android's MapView (v1 API) class. It also includes a modular tile provider system with support for numerous online and offline tile sources and overlay support with built-in overlays for plotting icons, tracking location, and drawing shapes.

Get it on F-Droid Get it on F-Droid

Current Release: 6.0.1 Feb 18st, 2018 Current Development version: 6.0.2-SNAPSHOT Next Release Version (planned): 6.0.2 (or possibly 6.1.0)

Note: check your calendar, it may take up to a few days for all global mirrors to update.

Please read the osmdroid wiki for tutorials on integration.

Gradle dependency

repositories {
        mavenCentral()
}

dependencies {
    compile 'org.osmdroid:osmdroid-android:<VERSION>'
}

Be sure to replace <VERSION> with the last release version above.

Maven dependency

<dependency>
  <groupId>org.osmdroid</groupId>
  <artifactId>osmdroid-android</artifactId>
  <version><VERSION></version>
  <type>aar</type>
</dependency>

Platform or API Level (API level 8 = Platform 2.2)

<platform>8</platform>

You can also compile osmdroid from source or download the dependency directly from OSS or download the distribution package

Want the latest and greatest?

We are currently working on a major update for osmdroid. If you're interesting in trying it out, using the following:

repositories {
    mavenCentral()
    maven{
        url  'https://oss.sonatype.org/content/repositories/snapshots/'
        name 'OSS-Sonatype'
    }
}
dependencies {
    compile 'org.osmdroid:osmdroid-android:6.0.0-SNAPSHOT'
}

Use at your own risk though, it may not be stable or may have bugs or performance issues. If you run across any, please report them.

In case gradle doesn't resolve it, it can be download manually here: https://oss.sonatype.org/service/local/repositories/snapshots/content/org/osmdroid/osmdroid-android/6.0.0-SNAPSHOT/osmdroid-android-6.0.0-SNAPSHOT.aar

Side note: gradle's cached dependencies and doesn't really handle snapshot very well. To force gradle to update snapshots on every build, try adding this to your root build.gradle file.

allprojects  {
  // forces all changing dependencies (i.e. SNAPSHOTs) to automagicially download
    configurations.all {
        resolutionStrategy {
            cacheChangingModulesFor 0, 'seconds'
    }
}

You can also build your project using the gradle option --refreshDependencies

OK now what?

Continue reading here, How-to-use-the-osmdroid-library

Related and important wiki articles

I have a question or want to report a bug

If you have a question, please view the osmdroid FAQ.
You can also view the Stack Overflow osmdroid tag and osmdroid Google Group where you can get feedback from a large pool of osmdroid users.

If you still have an issue, please check the Changelog page to see if this issue is fixed in a newer or upcoming version of osmdroid.

If think you have a legitimate bug to report then go to the Issues page to see if your issue has been reported. If your issue already exists then please contribute information that will help us track down the source of the issue. If your issue does not exist then create a new issue report. When creating an issue, please include the version of osmdroid, the Android platform target and test device you are using, and a detailed description of the problem with relevant code. It is particularly helpful if you can reproduce the problem using our OpenStreetMapViewer sample project as your starting point.

I want to contribute

See our contributing guide

I want more!

The OSMBonusPack project adds additional functionality for use with osmdroid projects.

Screenshots

Demo Videos

Free Draw

Maps Forge

Floating point zoom

IIS Tracker

Building from source and using the aar in your app

Thanks to Gradle Fury, this publishes the artifacts to mavenLocal.

./gradlew clean install

In your root build.gradle file, add mavenLocal() if not present.

allprojects {
    repositories {
            mavenCentral()
            mavenLocal()    //add this if it's missing
    }
}

Then in your APK or AAR project that needs osmdroid.

    compile 'org.osmdroid:osmdroid-android:<VERSION>-SNAPSHOT:debug@aar'

Where VERSION is the version listed as the value for pom.version in gradle.properties. Note that when using the release versions from Maven Central, drop the :debug@aar part. When using a "release" version that you build locally with gradle, you'll need :debug@aar instead.