Plugins are single-purpose libraries built on top of the MapLibre Maps SDK for Android that you can include in your apps like any other Android dependency
Plugins are single-purpose libraries built on top of the MapLibre Native Android that you can include in your apps like any other Android dependency. A full list of the current plugins is available below.
We are looking for maintainers for these plugins! Please reach out to the Maplibre team and take a look at the contribution guide.
-
Annotation: Simplify the way to set and adjust the visual properties of annotations on a map.
-
Traffic: Adds a real-time traffic layer to any MapLibre base map.
-
Location layer: [Deprecated] Add a location marker on your map indicating the user's location.
-
Localization: Have your map's text automatically match the device's default language setting.
-
Scale bar: Provide a visual map scale bar for your users to determine distance.
By using a plugin, you also have to include the MapLibre GL Native for Android which means that you'll need to setup your project to use the Maps SDK if you haven't already. Head over to the overview page for the Maps SDK to learn more.
Note that depending on the plugin you add, there might be required permissions and additional setup steps. You'll find more information on whether or not more configuration steps are involved when looking at the specific plugin documentation.
- Start Android Studio
- Open up your application's
build.gradle
- Make sure that your project's
minSdkVersion
is at API 14 or higher - Under dependencies, add a new build rule for the latest plugin version you are trying to use.
repositories {
mavenCentral()
}
dependencies {
implementation 'org.maplibre.gl:android-{PLUGIN_NAME}-v{MAJOR_MAPS_SDK_VERSION_NUMBER}:PLUGIN_VERSION_NUMBER'
}
Plugin artifacts are versioned based on the major release of the Maps SDK for Android, which means, that each artifact's name has a major version of the Maps SDK it's compatible with appended.
- Click the Sync Project with Gradle Files near the toolbar in Studio.
The MapLibre Plugins for Android are heavily dependent on the major semantic versioning number of the Maps SDK. They either won't compile or hide runtime bugs when paired with a different major version of the Maps SDK. Each plugin's dependency name has a vX
suffix which states the major version of the Maps SDK that the plugin is compatible with. This suffix makes the transition between versions easier and more educated without the need to jump into changelogs and compare repositories.
A plugin is simply a library module built on top of the MapLibre Maps SDK for Android. Plugins can be easy to use. Currently, we are not requiring plugins to register themselves or to implement any specific interfaces so that they're simple to consume.
This repository includes an app with examples showing how you can use each plugin.
- To access ready-to-use snippets, see its code here.
- To run the application locally, you need to provide your own maptiler API key at compile time. Therefore, add the property
maptilerApiKey="…"
to yourlocal.properties
file in the repository's root.
This might change in the future as we build more plugins and learn how you use them. We'd love to hear your feedback.
Splitting specific functionality into plugins makes our Maps SDK lighter and nimble for you to use, and it also lets us iterate faster. We can release plugins more often than the SDK, which requires a slower pace due to its larger codebase.
The MapLibre Android team creates plugins but this plugins repository is an open-source project similar to the various MapLibre SDKs for Android. Plugins' lightweight nature makes them much easier for you and anyone else to contribute rather than trying to add the same feature to the more robust Maps SDK. The MapLibre team can also more easily accept contributed plugins and keep the plugin list growing.
We welcome contributions to this plugin repository!
If you're interested in building and sharing your own plugin, please read the contribution guide to learn how to get started.