MapLibre Native - Interactive vector tile maps for iOS, Android and other platforms. https://maplibre.org
  • C++ 54.9%
  • Kotlin 11.4%
  • Java 10.9%
  • Objective-C++ 9.2%
  • Objective-C 6%
  • Other 7.4%
Find a file
Volodymyr Mykhailiuk d7dd0a4ff3
Plugin API: load layer resources asynchronously as tile dependencies (#5060)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-12-02 15:03:23 +02:00
.aspect/rules/external_repository_action_cache Use ESM in Node.js code generation scripts (#2739) 2024-08-23 14:31:36 +02:00
.github ci: stop using pull_request_target, treat workflow_run artifacts as untrusted (#5074) 2026-11-30 13:47:40 +02:00
.well-known Update funding-manifest-urls URL to remove www prefix (#3997) 2025-12-09 17:47:08 +01:00
bazel Plugin API: load layer resources asynchronously as tile dependencies (#5060) 2026-12-02 15:03:23 +02:00
benchmark core/ios: require 15.5 and remove obsolete compatibility code (#4656) 2026-09-19 17:56:13 +02:00
bin feat(build): add MLN_WITH_TOOLS (#5073) 2026-11-21 02:19:51 +00:00
cmake Plugin API: load layer resources asynchronously as tile dependencies (#5060) 2026-12-02 15:03:23 +02:00
design-proposals core: rename mbgl directories to mln (#4511) 2026-08-22 20:50:14 +02:00
docker fix: typos (#4202) 2026-07-13 15:08:27 +00:00
docs ci(ios): run the iOS benchmark on AWS Device Farm and store results on S3 (#5068) 2026-11-21 12:55:29 -08:00
expression-test refactor(build): define the test runners next to their sources (#5077) 2026-11-23 10:55:13 -05:00
include/mln Plugin API: load layer resources asynchronously as tile dependencies (#5060) 2026-12-02 15:03:23 +02:00
metrics fix(core): apply fraction digit limits to currency number formats (#4986) 2026-11-26 18:13:08 +01:00
misc Update Linux docs, add to Developer Documentation (#3451) 2025-05-13 14:09:43 +02:00
platform fix(android): redraw a TextureView map when its window becomes visible (#5149) 2026-11-29 10:48:24 +01:00
plugins Plugin API: load layer resources asynchronously as tile dependencies (#5060) 2026-12-02 15:03:23 +02:00
render-test Restructure plugins with generated wrappers, a circle layer plugin, demo apps and CI render tests (#4857) 2026-11-16 15:02:17 +01:00
rustutils build(ios): bundle XCFramework debug symbols and update Bazel dependencies (#4698) 2026-10-05 21:26:39 +02:00
scripts Release MapLibre Android 13.8.0 (#5115) 2026-11-25 22:10:32 +01:00
shaders Add fill style property that enables rounded corners for fill layers polygons (Core feature) (#4670) 2026-11-24 21:13:30 +01:00
src/mln Plugin API: load layer resources asynchronously as tile dependencies (#5060) 2026-12-02 15:03:23 +02:00
test Plugin API: load layer resources asynchronously as tile dependencies (#5060) 2026-12-02 15:03:23 +02:00
vendor refactor(build): define the vendored glslang in a file of its own (#5079) 2026-11-23 02:39:31 +00:00
.bazelignore core: Add HarmonyOS platform (#4315) 2026-09-19 02:44:42 +00:00
.bazelrc ci: speed up iOS, macOS, Android and desktop CI (#4812) 2026-10-20 22:52:00 +02:00
.bazelversion ci(ios): downgrade Bazel to 8.6.0 and revert #4733 (#4739) 2026-10-09 10:16:19 +02:00
.clang-format ios: apply clang-format to Objective-C++ sources (#4060) 2026-02-24 13:37:35 +00:00
.clang-tidy Enable more clang-tidy checks (#4863) 2026-10-30 19:56:33 +01:00
.gitattributes Add Windows to CI tests (#2968) 2024-12-01 00:21:25 +01:00
.gitignore Ignore generated expression and render test reports (#4607) 2026-09-10 08:39:58 -07:00
.gitmodules Vendor wagyu in-tree, replacing the submodule (#4893) 2026-11-01 15:38:31 +00:00
.npmignore Feature - Bring back node support (#217) 2022-02-08 20:40:19 +01:00
.nvmrc Add script for validating PR title (#4050) 2026-01-14 18:54:02 +01:00
.pre-commit-config.yaml Run iOS CI on GitHub-hosted macOS (#4359) 2026-06-24 03:03:38 +00:00
ARCHITECTURE.md core: rename mbgl directories to mln (#4511) 2026-08-22 20:50:14 +02:00
BUILD.bazel build(ios): bundle XCFramework debug symbols and update Bazel dependencies (#4698) 2026-10-05 21:26:39 +02:00
CHANGELOG.md fix(core): apply feature state to a tile once, then only changes (#4919) 2026-11-20 21:39:04 +00:00
CMakeLists.txt Plugin API: load layer resources asynchronously as tile dependencies (#5060) 2026-12-02 15:03:23 +02:00
CMakePresets.json feat(build): add MLN_WITH_TOOLS (#5073) 2026-11-21 02:19:51 +00:00
CODE-OF-CONDUCT.md Update CODE-OF-CONDUCT.md (#385) 2022-08-10 23:41:03 -04:00
codecov.yml [general] moving ios and android project under ./platform folder 2020-12-20 12:38:56 +01:00
CONTRIBUTING.md Link AI Policy from CONTRIBUTING.md (#4249) 2026-04-22 09:07:56 -07:00
flake.lock build: add Nix flake with Linux and Android dev shells (#4729) 2026-10-08 21:10:19 +02:00
flake.nix build: add Nix flake with Linux and Android dev shells (#4729) 2026-10-08 21:10:19 +02:00
FORK.md Fix trailing whitespaces (#3205) 2025-02-09 03:33:24 +00:00
LICENSE.md Copyright to MapLibre contributors (#48) 2021-03-12 13:59:33 +01:00
LICENSES.core.md Update licenses (#3991) 2025-12-09 11:04:01 +00:00
MODULE.bazel ios: remove Mapbox.h (#4731) 2026-10-11 07:07:25 +02:00
package-lock.json chore: remove unused minimatch dependency (#4907) 2026-11-03 12:11:55 +00:00
package.json chore: remove unused minimatch dependency (#4907) 2026-11-03 12:11:55 +00:00
pnpm-lock.yaml chore: remove unused minimatch dependency (#4907) 2026-11-03 12:11:55 +00:00
qt_attribution.json Update remaining MapLibre GL to MapLibre Native (#1216) 2023-06-07 17:40:54 +02:00
README.md Logo update in sponsorship section (#4645) 2026-09-18 10:16:23 +02:00
SECURITY.md Fix trailing whitespaces (#3205) 2025-02-09 03:33:24 +00:00
tsconfig.json Restructure plugins with generated wrappers, a circle layer plugin, demo apps and CI render tests (#4857) 2026-11-16 15:02:17 +01:00

MapLibre Logo MapLibre Logo

MapLibre Native

codecov

MapLibre Native is a free and open-source library for publishing maps in your apps and desktop applications on various platforms. Fast displaying of maps is possible thanks to GPU-accelerated vector tile rendering.

This project originated as a fork of Mapbox GL Native, before their switch to a non-OSS license in December 2020. For more information, see: FORK.md.

Android device with MapLibre iOS device with MapLibre

Getting Started

Android

Add the latest version of MapLibre Native Android as a dependency to your project.

    dependencies {
        ...
        implementation 'org.maplibre.gl:android-sdk:11.11.0'
        ...
    }

Add a MapView to your layout XML file:

<org.maplibre.android.maps.MapView
    android:id="@+id/mapView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    />

Tip

There are external projects such as Ramani Maps and MapLibre Compose Playground available to integrate MapLibre Native Android with Compose-based projects.

Next, initialize the map in an activity:

Show code
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.LayoutInflater
import org.maplibre.android.MapLibre
import org.maplibre.android.camera.CameraPosition
import org.maplibre.android.geometry.LatLng
import org.maplibre.android.maps.MapView
import org.maplibre.android.testapp.R

class MainActivity : AppCompatActivity() {

    // Declare a variable for MapView
    private lateinit var mapView: MapView

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        // Init MapLibre
        MapLibre.getInstance(this)

        // Init layout view
        val inflater = LayoutInflater.from(this)
        val rootView = inflater.inflate(R.layout.activity_main, null)
        setContentView(rootView)

        // Init the MapView
        mapView = rootView.findViewById(R.id.mapView)
        mapView.getMapAsync { map ->
            map.setStyle("https://demotiles.maplibre.org/style.json")
            map.cameraPosition = CameraPosition.Builder().target(LatLng(0.0,0.0)).zoom(1.0).build()
        }
    }

    override fun onStart() {
        super.onStart()
        mapView.onStart()
    }

    override fun onResume() {
        super.onResume()
        mapView.onResume()
    }

    override fun onPause() {
        super.onPause()
        mapView.onPause()
    }

    override fun onStop() {
        super.onStop()
        mapView.onStop()
    }

    override fun onLowMemory() {
        super.onLowMemory()
        mapView.onLowMemory()
    }

    override fun onDestroy() {
        super.onDestroy()
        mapView.onDestroy()
    }

    override fun onSaveInstanceState(outState: Bundle) {
        super.onSaveInstanceState(outState)
        mapView.onSaveInstanceState(outState)
    }
}

For more information, refer to the Android API Documentation or the Android Examples Documentation.

iOS

You can find MapLibre Native iOS on Cocoapods and on the Swift Package Index. You can also add MapLibre Native iOS as a dependency to Xcode directly.

MapLibre Native iOS uses UIKit. To integrate it with an UIKit project, you can use

class SimpleMap: UIViewController, MLNMapViewDelegate {
    var mapView: MLNMapView!

    override func viewDidLoad() {
        super.viewDidLoad()
        mapView = MLNMapView(frame: view.bounds)
        mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
        view.addSubview(mapView)
        mapView.delegate = self
    }

    func mapView(_: MLNMapView, didFinishLoading _: MLNStyle) {
    }
}

You need to create a wrapper when using SwiftUI.

import MapLibre

struct SimpleMap: UIViewRepresentable {
    func makeUIView(context _: Context) -> MLNMapView {
        let mapView = MLNMapView()
        return mapView
    }

    func updateUIView(_: MLNMapView, context _: Context) {}
}

Tip

You can also use MapLibreSwiftUI, a wrapper around MapLibre Native iOS that offers a declarative API like SwiftUI.

The iOS Documentation contains many examples and the entire API of the library.

Node.js

There is an npm package for using MapLibre Native in a Node.js project. The source code of this project can be found in this repository.

Qt

Please check out the maplibre/maplibre-native-qt repository to learn how to integrate MapLibre Native with a Qt project.

Compose Multiplatform

MapLibre Compose wraps MapLibre Native for various platforms that Compose Multiplatform supports. As of August 2025, iOS and Android are supported, with web and desktop partially supported.

Other Platforms

MapLibre Native can also be built on Linux, Windows and macOS.

Contributing

Note

This section is only relevant for people who want to contribute to MapLibre Native.

MapLibre Native has at its core a C++ library. This is where the bulk of development is currently happening.

To get started with the code base, you need to clone the repository including all its submodules.

All contributors use pull requests from a private fork. Fork the project. Then run:

git clone --recurse-submodules git@github.com:<YOUR NAME>/maplibre-native.git
git remote add origin https://github.com/maplibre/maplibre-native.git

The go-to reference is the MapLibre Native Developer Documentation.

Tip

Check out issues labelled as a good first issue.

Core

Android

Open platform/android with Android Studio.

More information: MapLibre Android Developer Guide.

iOS

You need to use Bazel to generate an Xcode project. Install bazelisk (a wrapper that installs the required Bazel version). Next, use:

bazel run //platform/ios:xcodeproj --@rules_xcodeproj//xcodeproj:extra_common_flags="--//:renderer=metal"
xed platform/ios/MapLibre.xcodeproj

To generate and open the Xcode project.

More information: MapLibre iOS Developer Guide.

Other Platforms

See /platform and navigate to the platform you are interested in for more information.

Getting Involved

Join the #maplibre-native Slack channel at OSMUS. Get an invite at https://slack.openstreetmap.us/

Become a Sponsor 💰

We thank everyone who supported us financially in the past and special thanks to the people and organizations who support us with recurring donations!

Read more about the MapLibre Sponsorship Program at https://maplibre.org/sponsors/.

Gold:

Logo AWS

Silver:

Logo Microsoft

Logo MIERUNE

Logo komoot

Logo JawgMaps

Logo Radar

Logo mapme

Logo maptiler

Logo CalTopo

Logo SmartMaps

Backers and Supporters:

License

MapLibre Native is licensed under the BSD 2-Clause License.