https://github.com/osmdroid/osmdroid
OSMdroid的使用基础: https://www.xuebuyuan.com/799248.html
https://www.oschina.net/p/osmdroid?hmsr=aladdin1e1
README.md
osmdroid

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.
Note: check your calendar, it may take up to a few days for all global mirrors to update.Current Release: 6.1.8 July 26, 2020
Current Development version: 6.1.9-SNAPSHOT
Next Release Version (planned): 6.1.9
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 periodically publish snapshots to maven central. 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:<VERSION>-SNAPSHOT:debug@aar'
}
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/-SNAPSHOT/osmdroid-android--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
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.
osmdroid教程
Welcome to the osmdroid!欢迎来到osmdroid!
Chances are good that you want to get a map up and running in your app as soon as possible. If that's the case, consider reading the following guides (they are short!) in this order.
- Include the binaries in your project:
- Walk through the tutorial
Usage Guides
- How to use the osmdroid library
- Markers, Lines and Polygons
- Geopackage
- Cache Manager
- WMS
- Tile Caching Settings
- osmdroid thirdparty
- MapsForge
- Ground Overlay
Upgrades and Changes
Understanding osmdroid's architecture and design
Commonly asked questions
- How big is it
- Capabilities
- Important notes on using osmdroid in your app
- FAQ
- If you get 'resource not found' error
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)