Crates.io | maplibre_native |
lib.rs | maplibre_native |
version | 0.3.0 |
created_at | 2025-03-07 05:35:16.408209+00 |
updated_at | 2025-09-25 23:57:23.969201+00 |
description | Rust bindings to the MapLibre Native map rendering engine |
homepage | |
repository | https://github.com/maplibre/maplibre-native-rs |
max_upload_size | |
id | 1582390 |
size | 137,536 |
Rust bindings to the MapLibre Native map rendering engine.
We use maplibre-native
s' core build, a static, pre-compiled library.
We also allow you to compile this yourself. Instructions for this are below.
This crate supports multiple rendering backends:
vulkan
(default on Linux/Windows): cargo build --features vulkan
opengl
(cross-platform): cargo build --features opengl
metal
(default on macOS/iOS): cargo build --features metal
If no feature is specified, the crate will automatically select the platform-appropriate default backend.
The following platform and rendering-API combinations are supported and tested in CI:
Platform | Metal | Vulkan | OpenGL |
---|---|---|---|
Linux x86 | ❌ | ✅ | ✅ |
Linux ARM | ❌ | ✅ | ✅ |
Windows x86 | ❌ | 🟨 | 🟨 |
Windows ARM | ❌ | 🟨 | 🟨 |
macOS ARM | 🟨 | 🟨1 | ❌ |
This command will install the required dependencies on Linux or macOS for the vulkan
backend.
You may also use it with opengl
parameter on Linux.
It is OK to run this command multiple times for each backend.
just install-dependencies vulkan
Since we wrap the Maplibre native library, we need this and its headers to be included.
We can get the library and headers from two places:
The specific version of MapLibre Native used is controlled by package.metadata.mln.release
in Cargo.toml
.
This dependency is automatically updated via a GitHub workflow on the 1st of each month repository.
A pull request is created if an update is available.
MLN_CORE_HEADERS_PATH
are set: from local disk via the environment variablesIf you don't want to allow network access during buildscript execution, we allow you to download the release and tell us where you have downloaded the contents. You can also build from source by following the steps that maplibre-native does in CI to produce the artefacts.
make
.
Install it with cargo install just
.just
.just test
.Join the #maplibre-martin
slack channel at OSMUS -- automatic invite is at https://slack.openstreetmap.us/
Licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.
This crate incorporates MapLibre Native assets during compilation by downloading and statically linking them. As a result, any project using this crate must comply with the MapLibre Native License (BSD 2-Clause) requirements for binary distribution. This includes providing proper attribution and including the license text with your distributed binaries or source code.
Vulcan support on macos is provided via MoltenVK. There is a slight performance overhead for this with little upsides. Both Metal and Vulcan run through the same extensive test suite upstream. You can use Vulcan if you find a bug in the Metal implementation until we have fixed it upstream. ↩