maplibre-navigation-android
5.0.0-pre14indexedEnables turn-by-turn navigation in Android apps by utilizing hosted map tiles and Directions API, removing UI components and telemetry for a purely logic-based, open-source solution.
Enables turn-by-turn navigation in Android apps by utilizing hosted map tiles and Directions API, removing UI components and telemetry for a purely logic-based, open-source solution.
The Maplibre Navigation SDK for Android is built on a fork of the Mapbox Navigation SDK v0.19 which is built on top of the Mapbox Directions API and contains the logic needed to get timed navigation instructions.
With this SDK you can implement turn-by-turn navigation in your own Android app while hosting your Map tiles and Directions API.
[!NOTE]
We are currently active working on converting this pure Android library to a Kotlin Multiplatform library.
All issues are covered with this SDK.
This library is available on Maven Central. To use it, add the following to your build.gradle:
Step 2. Add the dependency
// Core KMP library (without UI)
implementation 'org.maplibre.navigation:navigation-core:5.0.0-pre13'
// UI library (Android only)
implementation 'org.maplibre.navigation:navigation-ui-android:5.0.0-pre13'
The Android varoant of navigation-core is fully FLOSS, therefore Google's location library com.google.android.gms.* is not used by default.
If you instead want location updates backed by Google Play Services
(FusedLocationProviderClient), add the optional add-on module and pass GoogleLocationEngine
explicitly when creating navigation:
// Optional, Android only — pulls in com.google.android.gms:play-services-location.
// Do NOT add this to F-Droid / fully FLOSS builds.
implementation 'org.maplibre.navigation:navigation-location-gms-android:5.0.0-pre13'
import org.maplibre.navigation.core.gms.location.engine.GoogleLocationEngine
val navigation = AndroidMapLibreNavigation(
context = context,
locationEngine = GoogleLocationEngine(context, Looper.getMainLooper()),
)
We have added an Android example app to this repo.
The Valhalla example is aready pre-configured. All other examples needs to be configured with your own tile and direction server. This URLs needs to be set in developer-config.xml, which is generated on first Gradle run.
The new Kotlin Multiplatform library for iOS and Android has it's own small sample apps for all supported platforms.
We welcome feedback, translations, and code contributions! Please see CONTRIBUTING.md for details.
Surfaced from shared tags and platforms — no rankings paid for.